class Rrxcell::Excelx::Cell

Public Instance Methods

object() click to toggle source
# File lib/rrxcell/excelx/cell.rb, line 9
def object
  sheet.object.cell(row.position + 1, position + 1)
end
type() click to toggle source
# File lib/rrxcell/excelx/cell.rb, line 5
def type
  sheet.object.celltype(row.position + 1 , position + 1)
end
value() click to toggle source
# File lib/rrxcell/excelx/cell.rb, line 13
def value
  case type
  when :time
    value_as_time
  else
    raw_value
  end
end

Private Instance Methods

raw_value() click to toggle source
# File lib/rrxcell/excelx/cell.rb, line 24
def raw_value
  row.object.at(position)
end
value_as_time() click to toggle source
# File lib/rrxcell/excelx/cell.rb, line 28
def value_as_time
  h = (raw_value / 3600).to_i
  m = (((raw_value / 60).to_i) % 60).to_i
  s = (raw_value % 60).to_i
  today = Date.today
  Time.new(today.year, today.month, today.day, h, m, s)
end