Class: RowChange

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row_mode, cells) ⇒ RowChange

Returns a new instance of RowChange.



7
8
9
10
11
# File 'lib/coopy/row_change.rb', line 7

def initialize(row_mode,cells)
  @row_mode = row_mode
  @cells = cells
  @key = nil
end

Instance Attribute Details

#cellsObject

Returns the value of attribute cells.



3
4
5
# File 'lib/coopy/row_change.rb', line 3

def cells
  @cells
end

#columnsObject

Returns the value of attribute columns.



4
5
6
# File 'lib/coopy/row_change.rb', line 4

def columns
  @columns
end

#keyObject

Returns the value of attribute key.



5
6
7
# File 'lib/coopy/row_change.rb', line 5

def key
  @key
end

#row_modeObject

Returns the value of attribute row_mode.



2
3
4
# File 'lib/coopy/row_change.rb', line 2

def row_mode
  @row_mode
end

Instance Method Details

#active_columnsObject



13
14
15
16
# File 'lib/coopy/row_change.rb', line 13

def active_columns
  return [] if @columns.nil?
  @columns.column_by_offset
end

#new_value_at(column) ⇒ Object



22
23
24
# File 'lib/coopy/row_change.rb', line 22

def new_value_at(column)
  @cells[column[:in_offset]][:new_value]
end

#value_at(column) ⇒ Object



18
19
20
# File 'lib/coopy/row_change.rb', line 18

def value_at(column)
  @cells[column[:in_offset]][:value]
end