class BotConsole::SyncWatcher
Public Class Methods
Source
# File lib/bot_console/sync_watcher.rb, line 15 def initialize(root:) @root = root @path = File.join(root, "data", SYNC_FILENAME) @last_at = nil end
Public Instance Methods
Source
# File lib/bot_console/sync_watcher.rb, line 21 def apply_pending!(manager) payload = read_payload return unless payload at = payload["at"].to_s return if at.empty? || at == @last_at @last_at = at apply_action(manager, payload) FileUtils.rm_f(@path) end