Class: Spread2RDF::Mapping::Cell
- Includes:
- ResourceCreation
- Defined in:
- lib/spread2rdf/mapping/cell.rb,
lib/spread2rdf/mapping/default_cell_mappings.rb
Defined Under Namespace
Modules: Default
Instance Attribute Summary collapse
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Attributes inherited from Element
Instance Method Summary collapse
- #_children_ ⇒ Object
- #coord ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(sheet, parent, row) ⇒ Cell
constructor
A new instance of Cell.
- #map ⇒ Object
- #object ⇒ Object
- #value ⇒ Object (also: #resource_creation_value)
Methods included from ResourceCreation
Methods inherited from Element
Constructor Details
#initialize(sheet, parent, row) ⇒ Cell
Returns a new instance of Cell.
11 12 13 14 15 |
# File 'lib/spread2rdf/mapping/cell.rb', line 11 def initialize(sheet, parent, row) super(sheet, parent) @row = row map end |
Instance Attribute Details
#row ⇒ Object (readonly)
Returns the value of attribute row.
6 7 8 |
# File 'lib/spread2rdf/mapping/cell.rb', line 6 def row @row end |
Instance Method Details
#_children_ ⇒ Object
128 129 130 |
# File 'lib/spread2rdf/mapping/cell.rb', line 128 def _children_ nil end |
#coord ⇒ Object
21 22 23 |
# File 'lib/spread2rdf/mapping/cell.rb', line 21 def coord Coord[column: schema.coord, row: row] end |
#empty? ⇒ Boolean
34 35 36 |
# File 'lib/spread2rdf/mapping/cell.rb', line 34 def empty? value.blank? end |
#map ⇒ Object
17 18 19 |
# File 'lib/spread2rdf/mapping/cell.rb', line 17 def map exec(&schema.block) unless empty? end |
#object ⇒ Object
30 31 32 |
# File 'lib/spread2rdf/mapping/cell.rb', line 30 def object @object ||= value && map_to_object(value) end |
#value ⇒ Object Also known as: resource_creation_value
25 26 27 |
# File 'lib/spread2rdf/mapping/cell.rb', line 25 def value @value ||= worksheet.cell_value(coord) end |