Class: Megam::Mixins::Assemblys
- Inherits:
-
Object
- Object
- Megam::Mixins::Assemblys
- Defined in:
- lib/megam/mixins/assemblys.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#mixins ⇒ Object
readonly
Returns the value of attribute mixins.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#policies ⇒ Object
readonly
Returns the value of attribute policies.
Instance Method Summary collapse
-
#initialize(params) ⇒ Assemblys
constructor
A new instance of Assemblys.
- #to_hash ⇒ Object
Constructor Details
#initialize(params) ⇒ Assemblys
Returns a new instance of Assemblys.
10 11 12 13 14 15 16 |
# File 'lib/megam/mixins/assemblys.rb', line 10 def initialize(params) params = Hash[params.map{ |k, v| [k.to_sym, v] }] @mixins = CommonDeployable.new(params) @outputs = Outputs.new(params) @components = add_components(params) @policies = [] end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
8 9 10 |
# File 'lib/megam/mixins/assemblys.rb', line 8 def components @components end |
#mixins ⇒ Object (readonly)
Returns the value of attribute mixins.
8 9 10 |
# File 'lib/megam/mixins/assemblys.rb', line 8 def mixins @mixins end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
8 9 10 |
# File 'lib/megam/mixins/assemblys.rb', line 8 def outputs @outputs end |
#policies ⇒ Object (readonly)
Returns the value of attribute policies.
8 9 10 |
# File 'lib/megam/mixins/assemblys.rb', line 8 def policies @policies end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/megam/mixins/assemblys.rb', line 18 def to_hash result = @mixins.to_hash result[:components] = @components if @components result[:outputs] = @outputs.to_array if @outputs result[:policies] = @policies if @policies [result] end |