Class: CatAPI::Image
- Inherits:
-
Object
- Object
- CatAPI::Image
- Defined in:
- lib/cat_api/image.rb
Instance Method Summary collapse
-
#initialize(xml) ⇒ Image
constructor
A new instance of Image.
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 |