Class: Listen::File
- Inherits:
-
Object
- Object
- Listen::File
- Defined in:
- lib/listen/file.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #change ⇒ Object
-
#initialize(path) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(path) ⇒ File
Returns a new instance of File.
5 6 7 8 |
# File 'lib/listen/file.rb', line 5 def initialize(path) @path = path @data = { type: 'File' } end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/listen/file.rb', line 3 def data @data end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/listen/file.rb', line 3 def path @path end |
Instance Method Details
#change ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/listen/file.rb', line 10 def change if _existing_path? && _modified? _set_record_data :modified elsif _new_path? _set_record_data :added elsif _removed_path? _unset_record_data :removed end end |