Class: Yesradio::Item
- Inherits:
-
Object
- Object
- Yesradio::Item
- Defined in:
- lib/item.rb
Class Attribute Summary (collapse)
-
+ (Object) elements
Returns the value of attribute elements.
Instance Method Summary (collapse)
-
- (Item) initialize(element = nil)
constructor
A new instance of Item.
Constructor Details
- (Item) initialize(element = nil)
A new instance of Item
12 13 14 15 16 17 |
# File 'lib/item.rb', line 12 def initialize(element = nil) self.class.elements.each do |name, type| new_value = get_element_child element, name.gsub('_', '/'), type self.instance_variable_set("@#{name}", new_value) unless new_value.nil? end end |
Class Attribute Details
+ (Object) elements
Returns the value of attribute elements
9 10 11 |
# File 'lib/item.rb', line 9 def elements @elements end |