Class: Coopy::NestedCellBuilder
- Inherits:
-
Object
- Object
- Coopy::NestedCellBuilder
- Defined in:
- lib/lib/coopy/nested_cell_builder.rb
Instance Method Summary collapse
- #conflict(parent, local, remote) ⇒ Object
-
#initialize ⇒ NestedCellBuilder
constructor
A new instance of NestedCellBuilder.
- #links(unit, row_like) ⇒ Object
- #marker(label) ⇒ Object
- #need_separator ⇒ Object
- #set_conflict_separator(separator) ⇒ Object
- #set_separator(separator) ⇒ Object
- #set_view(view) ⇒ Object
- #update(local, remote) ⇒ Object
Constructor Details
#initialize ⇒ NestedCellBuilder
Returns a new instance of NestedCellBuilder.
7 8 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 7 def initialize end |
Instance Method Details
#conflict(parent, local, remote) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 37 def conflict(parent,local,remote) h = @view.make_hash @view.hash_set(h,"before",parent) @view.hash_set(h,"ours",local) @view.hash_set(h,"theirs",remote) h end |
#links(unit, row_like) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 58 def links(unit,row_like) h = @view.make_hash if unit.p >= -1 @view.hash_set(h,"before",self.neg_to_null(unit.p)) @view.hash_set(h,"ours",self.neg_to_null(unit.l)) @view.hash_set(h,"theirs",self.neg_to_null(unit.r)) return h end @view.hash_set(h,"before",self.neg_to_null(unit.l)) @view.hash_set(h,"after",self.neg_to_null(unit.r)) h end |
#marker(label) ⇒ Object
45 46 47 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 45 def marker(label) @view.to_datum(label) end |
#need_separator ⇒ Object
16 17 18 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 16 def need_separator false end |
#set_conflict_separator(separator) ⇒ Object
23 24 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 23 def set_conflict_separator(separator) end |
#set_separator(separator) ⇒ Object
20 21 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 20 def set_separator(separator) end |
#set_view(view) ⇒ Object
26 27 28 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 26 def set_view(view) @view = view end |
#update(local, remote) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/lib/coopy/nested_cell_builder.rb', line 30 def update(local,remote) h = @view.make_hash @view.hash_set(h,"before",local) @view.hash_set(h,"after",remote) h end |