Class: Beatport::Catalog::Feature
- Defined in:
- lib/beatport/catalog/feature.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
associated this manually since we don’t know the type of the items by default.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Feature
constructor
A new instance of Feature.
Methods inherited from Item
#[], #associate, associations, find_by_name, has_many, has_one, #id, lazy_accessor, #type
Constructor Details
#initialize(data = {}) ⇒ Feature
Returns a new instance of Feature.
8 9 10 11 12 13 |
# File 'lib/beatport/catalog/feature.rb', line 8 def initialize(data = {}) item_klass = Support::Inflector.constantize("Beatport::Catalog::#{data['type']}") associate(data, 'items', true, item_klass) super end |
Instance Attribute Details
#items ⇒ Object (readonly)
associated this manually since we don’t know the type of the items by default
6 7 8 |
# File 'lib/beatport/catalog/feature.rb', line 6 def items @items end |