Class: DirSync::ChangeResolver
- Inherits:
-
Object
- Object
- DirSync::ChangeResolver
- Defined in:
- lib/dir_sync/change_resolver.rb
Instance Method Summary collapse
- #candidate ⇒ Object
- #debug(message) ⇒ Object
-
#initialize(history, *traversers) ⇒ ChangeResolver
constructor
A new instance of ChangeResolver.
- #iterate ⇒ Object
Constructor Details
#initialize(history, *traversers) ⇒ ChangeResolver
Returns a new instance of ChangeResolver.
9 10 11 |
# File 'lib/dir_sync/change_resolver.rb', line 9 def initialize history, *traversers @history, @traversers = history, traversers end |
Instance Method Details
#candidate ⇒ Object
22 23 24 |
# File 'lib/dir_sync/change_resolver.rb', line 22 def candidate candidates.first end |
#debug(message) ⇒ Object
5 6 7 |
# File 'lib/dir_sync/change_resolver.rb', line 5 def debug puts "# #{}" if ENV['DEBUG'] end |
#iterate ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/dir_sync/change_resolver.rb', line 13 def iterate report_traversers first = candidates.first return false unless first debug "first is #{first.description}" send dispatch(first), first advance_matching_traversers first.name, @history, *non_empty_traversers end |