Class: Coopy::NestedCellBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/coopy/nested_cell_builder.rb

Instance Method Summary collapse

Constructor Details

#initializeNestedCellBuilder

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


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_separatorObject



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