Sha256: 65f91d6c6b8e53e8961b10b6ff5b06ddf34285055ca42e986ca1bc858a5cd7d9

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

class ItemModifier
  attr_accessor :name, :modifier_id, :instructions

  # :internal => :external
  def self.attribute_map
  {
      :name => :name, :modifier_id => :modifier_id, :instructions => :instructions

  }
  end

  def initialize(attributes = {})
    # Morph attribute keys into undescored rubyish style
    if attributes.to_s != ""

      if ItemModifier.attribute_map["name".to_sym] != nil
        name = "name".to_sym
        value = attributes["name"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      if ItemModifier.attribute_map["modifier_id".to_sym] != nil
        name = "modifier_id".to_sym
        value = attributes["modifier_id"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      if ItemModifier.attribute_map["instructions".to_sym] != nil
        name = "instructions".to_sym
        value = attributes["instructions"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      end
  end

  def to_body
    body = {}
    ItemModifier.attribute_map.each_pair do |key,value|
      body[value] = self.send(key) unless self.send(key).nil?
    end
    body
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
subtledata-0.0.5 models/itemmodifier.rb