Class: FireflyServer::FileWatcher::ChangeEvent
- Inherits:
-
Object
- Object
- FireflyServer::FileWatcher::ChangeEvent
- Defined in:
- lib/firefly_server/file_watcher.rb
Constant Summary collapse
- CATEGORIES =
%w[ ignored modified added removed ]
Instance Method Summary collapse
- #files ⇒ Object
-
#initialize(params) ⇒ ChangeEvent
constructor
A new instance of ChangeEvent.
- #to_h ⇒ Object
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
#files ⇒ Object
68 69 70 |
# File 'lib/firefly_server/file_watcher.rb', line 68 def files (added + modified + removed) end |
#to_h ⇒ Object
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 |