Module: Extract::Tree::Cell

Defined in:
lib/extract/tree/cell.rb

Instance Method Summary collapse

Instance Method Details

#colObject



22
23
24
# File 'lib/extract/tree/cell.rb', line 22

def col
  c.text_value
end

#depsObject



25
26
27
# File 'lib/extract/tree/cell.rb', line 25

def deps
  [proper_cell]
end

#excel_valueObject



10
11
12
13
14
15
16
17
18
# File 'lib/extract/tree/cell.rb', line 10

def excel_value
  res = find_sheet[proper_cell]
  #raise proper_cell if text_value == "-A2"
  if res.present?
    leading_neg? ? res * -1 : res
  else
    res
  end
end

#leading_neg?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/extract/tree/cell.rb', line 7

def leading_neg?
  text_value[0..0] == '-'
end

#proper_cellObject



4
5
6
# File 'lib/extract/tree/cell.rb', line 4

def proper_cell
  text_value.gsub("-","").gsub("$","")
end

#rowObject



19
20
21
# File 'lib/extract/tree/cell.rb', line 19

def row
  r.text_value.to_i
end

#ttObject



28
29
30
# File 'lib/extract/tree/cell.rb', line 28

def tt
  :cell
end