Sha256: 82fb03913403885577dadd8122e4f0c82894023ca2a4e119bcd5099d1a662307

Contents?: true

Size: 330 Bytes

Versions: 7

Compression:

Stored size: 330 Bytes

Contents

module Razsell
  class Item
    def initialize values={}
      @values = values
      self.class.class_eval do
        add_attributes values
      end
    end

    def self.add_attributes values
      values.each_key do |key|
        define_method "#{key.to_s}" do
          @values[key]
        end\
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rubyyot-razsell-0.0.0 lib/item.rb
rubyyot-razsell-0.0.1 lib/item.rb
rubyyot-razsell-0.0.2 lib/item.rb
rubyyot-razsell-0.0.3 lib/item.rb
rubyyot-razsell-0.0.4 lib/item.rb
razsell-0.0.5 lib/razsell/item.rb
razsell-0.0.4 lib/item.rb