Sha256: 62f87eec15fec401d7493dd8fa3691d2fdabbbc2955023a06581fb75202606a5

Contents?: true

Size: 500 Bytes

Versions: 6

Compression:

Stored size: 500 Bytes

Contents

module CellSet
  class Cell
    ATTRIBUTES = [:formatted_value, :ordinal, :value]

    include Attributes
    include ActiveModel::Serializers::JSON
    include ActiveModel::Serializers::Xml
    self.include_root_in_json = false

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cell_set-0.2.3 lib/cell_set/cell.rb
cell_set-0.2.2 lib/cell_set/cell.rb
cell_set-0.2.1 lib/cell_set/cell.rb
cell_set-0.2.0 lib/cell_set/cell.rb
cell_set-0.1.4 lib/cell_set/cell.rb
cell_set-0.1.3 lib/cell_set/cell.rb