Class: Build::Files::Handle
- Inherits:
-
Object
- Object
- Build::Files::Handle
- Defined in:
- lib/build/files/handle.rb
Instance Attribute Summary collapse
-
#monitor ⇒ Object
readonly
Returns the value of attribute monitor.
Instance Method Summary collapse
-
#changed! ⇒ Object
Inform the handle that it might have been modified.
- #commit! ⇒ Object
- #directories ⇒ Object
-
#initialize(monitor, files, &block) ⇒ Handle
constructor
A new instance of Handle.
- #remove! ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#monitor ⇒ Object (readonly)
Returns the value of attribute monitor.
32 33 34 |
# File 'lib/build/files/handle.rb', line 32 def monitor @monitor end |
Instance Method Details
#changed! ⇒ Object
Inform the handle that it might have been modified.
47 48 49 50 51 52 |
# File 'lib/build/files/handle.rb', line 47 def changed! # If @state.update! did not find any changes, don't invoke the callback: if @state.update! @block.call(@state) end end |
#commit! ⇒ Object
34 35 36 |
# File 'lib/build/files/handle.rb', line 34 def commit! @state.update! end |
#directories ⇒ Object
38 39 40 |
# File 'lib/build/files/handle.rb', line 38 def directories @state.files.roots end |
#remove! ⇒ Object
42 43 44 |
# File 'lib/build/files/handle.rb', line 42 def remove! @monitor.delete(self) end |
#to_s ⇒ Object
54 55 56 |
# File 'lib/build/files/handle.rb', line 54 def to_s "\#<#{self.class} @state=#{@state} @block=#{@block}>" end |