class Coopy::NestedCellBuilder
Attributes
view[RW]
Public Class Methods
new()
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 7 def initialize end
Public Instance Methods
conflict(parent,local,remote)
click to toggle source
# 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)
click to toggle source
# 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)
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 45 def marker(label) @view.to_datum(label) end
need_separator()
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 16 def need_separator false end
set_conflict_separator(separator)
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 23 def set_conflict_separator(separator) end
set_separator(separator)
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 20 def set_separator(separator) end
set_view(view)
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 26 def set_view(view) @view = view end
update(local,remote)
click to toggle source
# 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
Protected Instance Methods
neg_to_null(x)
click to toggle source
# File lib/lib/coopy/nested_cell_builder.rb, line 51 def neg_to_null(x) return nil if x < 0 x end