Class: Xmlss::Element::Cell
- Inherits:
-
Object
- Object
- Xmlss::Element::Cell
- Includes:
- Enumeration
- Defined in:
- lib/xmlss/element/cell.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#formula ⇒ Object
Returns the value of attribute formula.
-
#href ⇒ Object
Returns the value of attribute href.
-
#index ⇒ Object
Returns the value of attribute index.
-
#merge_across ⇒ Object
Returns the value of attribute merge_across.
-
#merge_down ⇒ Object
Returns the value of attribute merge_down.
-
#style_id ⇒ Object
Returns the value of attribute style_id.
Class Method Summary collapse
Instance Method Summary collapse
- #data_xml_value ⇒ Object
-
#initialize(*args) ⇒ Cell
constructor
A new instance of Cell.
Constructor Details
#initialize(*args) ⇒ Cell
Returns a new instance of Cell.
23 24 25 26 27 28 29 30 31 |
# File 'lib/xmlss/element/cell.rb', line 23 def initialize(*args) attrs = args.last.kind_of?(::Hash) ? args.pop : {} self.data = [args.last, attrs.delete(:data), ''].reject{|v| v.nil?}.first self.merge_across = attrs.delete(:merge_across) || 0 self.merge_down = attrs.delete(:merge_down) || 0 attrs.keys.each { |k| self.send("#{k}=", attrs[k]) } end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
12 13 14 |
# File 'lib/xmlss/element/cell.rb', line 12 def data @data end |
#formula ⇒ Object
Returns the value of attribute formula.
10 11 12 |
# File 'lib/xmlss/element/cell.rb', line 10 def formula @formula end |
#href ⇒ Object
Returns the value of attribute href.
10 11 12 |
# File 'lib/xmlss/element/cell.rb', line 10 def href @href end |
#index ⇒ Object
Returns the value of attribute index.
10 11 12 |
# File 'lib/xmlss/element/cell.rb', line 10 def index @index end |
#merge_across ⇒ Object
Returns the value of attribute merge_across.
10 11 12 |
# File 'lib/xmlss/element/cell.rb', line 10 def merge_across @merge_across end |
#merge_down ⇒ Object
Returns the value of attribute merge_down.
10 11 12 |
# File 'lib/xmlss/element/cell.rb', line 10 def merge_down @merge_down end |
#style_id ⇒ Object
Returns the value of attribute style_id.
10 11 12 |
# File 'lib/xmlss/element/cell.rb', line 10 def style_id @style_id end |
Class Method Details
.writer ⇒ Object
8 |
# File 'lib/xmlss/element/cell.rb', line 8 def self.writer; :cell; end |
Instance Method Details
#data_xml_value ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/xmlss/element/cell.rb', line 38 def data_xml_value case self.data when ::Date, ::Time, ::DateTime self.data.strftime("%Y-%m-%dT%H:%M:%S") when ::TrueClass 1 when ::FalseClass 0 else self.data.to_s end end |