Class: CellSet::Cell

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serializers::JSON, ActiveModel::Serializers::Xml, Attributes
Defined in:
lib/cell_set/cell.rb

Constant Summary collapse

ATTRIBUTES =
[:formatted_value, :ordinal, :value]

Instance Method Summary collapse

Methods included from Attributes

#attributes, #attributes=, #clear_attribute, #has_attribute?, #initialize, #read_attribute_for_validation

Instance Method Details

#from_jsonObject



10
11
12
# File 'lib/cell_set/cell.rb', line 10

def from_json(*)
  super.tap{|obj| obj.freeze}
end

#ordinal=(ordinal) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/cell_set/cell.rb', line 14

def ordinal=(ordinal)
  @ordinal = if ordinal.is_a?(Fixnum)
   ordinal
  elsif ordinal.is_a?(String)
   Integer(ordinal)
  else
   raise ArgumentError
  end
end