Class: FireflyServer::FileWatcher::ChangeEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/firefly_server/file_watcher.rb

Constant Summary collapse

CATEGORIES =
%w[ ignored modified added removed ]

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ ChangeEvent

Returns a new instance of ChangeEvent.



62
63
64
65
66
# File 'lib/firefly_server/file_watcher.rb', line 62

def initialize(params)
  params.each do |key, value|
    send("#{key}=", value)
  end
end

Instance Method Details

#filesObject



68
69
70
# File 'lib/firefly_server/file_watcher.rb', line 68

def files
  (added + modified + removed)
end

#to_hObject



77
78
79
# File 'lib/firefly_server/file_watcher.rb', line 77

def to_h
  CATEGORIES.map { |category| [category.to_sym, send(category)] }.to_h
end