Class: DNApi::Components::Addons

Inherits:
Struct
  • Object
show all
Includes:
DNApi::Component, Enumerable
Defined in:
lib/dnapi/components/addons.rb

Defined Under Namespace

Classes: Addon

Instance Attribute Summary collapse

Attributes inherited from Struct

#parent

Instance Method Summary collapse

Methods included from DNApi::Component

[], #can_belong_to?, components, from, included, #key, #to_hash

Methods inherited from Struct

#==, #_many, _many, #_many_values, #_ones, _ones, #_ones_values, _umembers, belongs_to, from, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member

Methods included from Test::Ext

#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick

Constructor Details

#initialize(attrs = {}) ⇒ Addons

Returns a new instance of Addons.



12
13
14
15
# File 'lib/dnapi/components/addons.rb', line 12

def initialize(attrs = {})
  attrs[:collection] = (attrs['collection'] || attrs[:collection]).collect{ |v| Addon.new(v) }
  super attrs
end

Instance Attribute Details

#collectionObject

Returns the value of attribute collection

Returns:

  • (Object)

    the current value of collection



3
4
5
# File 'lib/dnapi/components/addons.rb', line 3

def collection
  @collection
end

Instance Method Details

#each(&block) ⇒ Object



17
18
19
# File 'lib/dnapi/components/addons.rb', line 17

def each(&block)
  collection.each(&block)
end