Sha256: 91058052d5abfd45e111ca777fad73ca91b031fb71693bc970d67fb72020f2d7
Contents?: true
Size: 1.51 KB
Versions: 1
Compression:
Stored size: 1.51 KB
Contents
class Local attr_accessor :description, :category_id, :name, :modifier_list # :internal => :external def self.attribute_map { :description => :description, :category_id => :category_id, :name => :name, :modifier_list => :modifier_list } end def initialize(attributes = {}) # Morph attribute keys into undescored rubyish style if attributes.to_s != "" if Local.attribute_map["description".to_sym] != nil name = "description".to_sym value = attributes["description"] send("#{name}=", value) if self.respond_to?(name) end if Local.attribute_map["category_id".to_sym] != nil name = "category_id".to_sym value = attributes["category_id"] send("#{name}=", value) if self.respond_to?(name) end if Local.attribute_map["name".to_sym] != nil name = "name".to_sym value = attributes["name"] send("#{name}=", value) if self.respond_to?(name) end if Local.attribute_map["modifier_list".to_sym] != nil name = "modifier_list".to_sym value = attributes["modifier_list"] if value.is_a?(Array) array = Array.new value.each do |arrayValue| array.push ModifierList.new(arrayValue) end send("#{name}=", array) if self.respond_to?(name) end end end end def to_body body = {} Local.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/local.rb |