Sha256: c14adf2a74eb99e7c5888a559775e4d74cd71bd53dc13c37aa9200f961beb456

Contents?: true

Size: 920 Bytes

Versions: 2

Compression:

Stored size: 920 Bytes

Contents

class ItemImage
  attr_accessor :image_url, :image_type_id

  # :internal => :external
  def self.attribute_map
  {
      :image_url => :image_url, :image_type_id => :image_type_id

  }
  end

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
subtledata-0.0.5 models/itemimage.rb
subtledata-0.0.3 models/itemimage.rb