Class: CatAPI::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/cat_api/image.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Image

Returns a new instance of Image.



3
4
5
6
7
8
# File 'lib/cat_api/image.rb', line 3

def initialize(xml)
  xml.elements.map do |attribute|
    instance_variable_set "@#{attribute.node_name}", attribute.text
    CatAPI::Image.class_eval { attr_reader attribute.node_name.to_sym }
  end
end