class Roo::Excelx::Cell::Base

Attributes

cell_type[R]
cell_value[R]
formatted_value[RW]
value[RW]

Public Class Methods

new(value, formula, excelx_type, style, link, coordinate) click to toggle source
# File lib/roo/excelx/cell/base.rb, line 41
def initialize(value, formula, excelx_type, style, link, coordinate)
  @cell_value = value
  @cell_type = excelx_type if excelx_type
  @formula = formula if formula
  @style = style unless style == 1
  @coordinate = coordinate
  @value = link ? Roo::Link.new(link, value) : value
end

Public Instance Methods

empty?() click to toggle source
# File lib/roo/excelx/cell/base.rb, line 98
def empty?
  false
end
excelx_type() click to toggle source

DEPRECATED: Please use cell_type instead.

# File lib/roo/excelx/cell/base.rb, line 93
def excelx_type
  warn '[DEPRECATION] `excelx_type` is deprecated.  Please use `cell_type` instead.'
  cell_type
end
excelx_value() click to toggle source

DEPRECATED: Please use cell_value instead.

# File lib/roo/excelx/cell/base.rb, line 87
def excelx_value
  warn '[DEPRECATION] `excelx_value` is deprecated.  Please use `cell_value` instead.'
  cell_value
end
formula?() click to toggle source
# File lib/roo/excelx/cell/base.rb, line 60
def formula?
  !!(defined?(@formula) && @formula)
end
presence() click to toggle source
# File lib/roo/excelx/cell/base.rb, line 102
def presence
  empty? ? nil : self
end
to_s() click to toggle source
# File lib/roo/excelx/cell/base.rb, line 70
def to_s
  formatted_value
end
type() click to toggle source
# File lib/roo/excelx/cell/base.rb, line 50
def type
  if formula?
    :formula
  elsif link?
    :link
  else
    default_type
  end
end