Class: DiffOutputGroup
- Inherits:
-
Object
- Object
- DiffOutputGroup
- Defined in:
- lib/coopy/diff_output_group.rb
Instance Method Summary collapse
- #<<(x) ⇒ Object
- #apply_row(rc) ⇒ Object
- #begin_diff ⇒ Object
- #end_diff ⇒ Object
-
#initialize(*sinks) ⇒ DiffOutputGroup
constructor
A new instance of DiffOutputGroup.
- #to_string ⇒ Object
- #want_context ⇒ Object
Constructor Details
#initialize(*sinks) ⇒ DiffOutputGroup
Returns a new instance of DiffOutputGroup.
5 6 7 |
# File 'lib/coopy/diff_output_group.rb', line 5 def initialize(*sinks) @sinks = sinks end |
Instance Method Details
#<<(x) ⇒ Object
9 10 11 12 |
# File 'lib/coopy/diff_output_group.rb', line 9 def <<(x) @sinks = [] if @sinks.nil? @sinks << x end |
#apply_row(rc) ⇒ Object
22 23 24 |
# File 'lib/coopy/diff_output_group.rb', line 22 def apply_row(rc) @sinks.each { |s| s.apply_row(rc) } end |
#begin_diff ⇒ Object
14 15 16 |
# File 'lib/coopy/diff_output_group.rb', line 14 def begin_diff @sinks.each { |s| s.begin_diff } end |
#end_diff ⇒ Object
18 19 20 |
# File 'lib/coopy/diff_output_group.rb', line 18 def end_diff @sinks.each { |s| s.end_diff } end |
#to_string ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/coopy/diff_output_group.rb', line 26 def to_string @sinks.each do |s| result = s.to_string return result if result!="" end "" end |
#want_context ⇒ Object
34 35 36 37 38 39 |
# File 'lib/coopy/diff_output_group.rb', line 34 def want_context return @want_context0 unless @want_context0.nil? @want_context0 = false @want_context0 = @sinks.each { |s| @want_context0 ||= s.want_context } @want_context0 end |