Class: Megam::Mixins::Components
- Inherits:
-
Object
- Object
- Megam::Mixins::Components
- Defined in:
- lib/megam/mixins/components.rb
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
readonly
Returns the value of attribute artifacts.
-
#envs ⇒ Object
readonly
Returns the value of attribute envs.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mixins ⇒ Object
readonly
Returns the value of attribute mixins.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#operations ⇒ Object
readonly
Returns the value of attribute operations.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#related_components ⇒ Object
readonly
Returns the value of attribute related_components.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
-
#initialize(params) ⇒ Components
constructor
A new instance of Components.
- #to_a ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(params) ⇒ Components
Returns a new instance of Components.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/megam/mixins/components.rb', line 9 def initialize(params) @mixins = CommonDeployable.new(params) @id = params[:id] if params[:id] @name = params[:componentname] || params[:name] || '' @outputs = Outputs.new(params) @operations = add_operations(params) @related_components = (params) @artifacts = add_artifacts(params) @repo = add_repo(params) @envs = params[:envs] end |
Instance Attribute Details
#artifacts ⇒ Object (readonly)
Returns the value of attribute artifacts.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def artifacts @artifacts end |
#envs ⇒ Object (readonly)
Returns the value of attribute envs.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def envs @envs end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def id @id end |
#mixins ⇒ Object (readonly)
Returns the value of attribute mixins.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def mixins @mixins end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def name @name end |
#operations ⇒ Object (readonly)
Returns the value of attribute operations.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def operations @operations end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def outputs @outputs end |
#related_components ⇒ Object (readonly)
Returns the value of attribute related_components.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def @related_components end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
8 9 10 |
# File 'lib/megam/mixins/components.rb', line 8 def repo @repo end |
Instance Method Details
#to_a ⇒ Object
34 35 36 |
# File 'lib/megam/mixins/components.rb', line 34 def to_a [to_hash] end |
#to_hash ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/megam/mixins/components.rb', line 21 def to_hash result = @mixins.to_hash result[:id] = @id if @id result[:name] = @name if @name result[:artifacts] = @artifacts if @artifacts result[:repo] = @repo if @repo result[:operations] = @operations if @operations result[:outputs] = @outputs.to_array if @outputs result[:related_components] = @related_components if @related_components result[:envs] = @envs if @envs result.to_hash end |