Class: Roo::Excelx::Cell::Date

Inherits:
DateTime show all
Defined in:
lib/roo/excelx/cell/date.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#style

Instance Method Summary collapse

Methods inherited from DateTime

#formatted_value

Methods inherited from Base

#empty?, #excelx_type, #excelx_value, #formula?, #hyperlink, #link?, #to_s, #type

Constructor Details

#initialize(value, formula, excelx_type, style, link, base_date, coordinate) ⇒ Date

Returns a new instance of Date.



9
10
11
12
13
14
15
# File 'lib/roo/excelx/cell/date.rb', line 9

def initialize(value, formula, excelx_type, style, link, base_date, coordinate)
  # NOTE: Pass all arguments to the parent class, DateTime.
  super
  @type = :date
  @format = excelx_type.last
  @value = link? ? Roo::Link.new(link, value) : create_date(base_date, value)
end

Instance Attribute Details

#cell_typeObject (readonly)

Returns the value of attribute cell_type.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def cell_type
  @cell_type
end

#cell_valueObject (readonly)

Returns the value of attribute cell_value.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def cell_value
  @cell_value
end

#coordinateObject (readonly)

Returns the value of attribute coordinate.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def coordinate
  @coordinate
end

#formatObject (readonly)

Returns the value of attribute format.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def format
  @format
end

#formulaObject (readonly)

Returns the value of attribute formula.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def formula
  @formula
end

Returns the value of attribute link.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def link
  @link
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/roo/excelx/cell/date.rb', line 7

def value
  @value
end