Sha256: 3b609bfacf511866aacf9130b0dd727514646ea65de431a9425795b958c8ce03

Contents?: true

Size: 392 Bytes

Versions: 6

Compression:

Stored size: 392 Bytes

Contents

module ContentsCore
  class ItemInteger < Item
    alias_attribute :data, :data_integer

    def init
      self.data = 0
      self
    end

    def update_data( value )
      self.data = value.to_i
      self.save
    end

    def to_s
      self.data.to_s
    end

    def self.permitted_attributes
      [ :data_integer ]
    end

    def self.type_name
      'integer'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
contents_core-0.2.5 app/models/contents_core/item_integer.rb
contents_core-0.2.4 app/models/contents_core/item_integer.rb
contents_core-0.2.2 app/models/contents_core/item_integer.rb
contents_core-0.2.0 app/models/contents_core/item_integer.rb
contents_core-0.1.9 app/models/contents_core/item_integer.rb
contents_core-0.1.8 app/models/contents_core/item_integer.rb