Class: Megam::Mixins::Components

Inherits:
Object
  • Object
show all
Defined in:
lib/megam/mixins/components.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Components

Returns a new instance of Components.



9
10
11
12
13
14
15
16
17
# File 'lib/megam/mixins/components.rb', line 9

def initialize(params)
  @mixins = CommonDeployable.new(params)
  @name = params[:componentname]
  @outputs = Outputs.new(params)
  @operations = add_operations(params)
  @related_components = add_related_components(params)
  @artifacts = add_artifacts(params)
  @repo = add_repo(params)
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

#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

Returns the value of attribute related_components.



8
9
10
# File 'lib/megam/mixins/components.rb', line 8

def related_components
  @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



30
31
32
# File 'lib/megam/mixins/components.rb', line 30

def to_a
  [to_hash]
end

#to_hash ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/megam/mixins/components.rb', line 19

def to_hash
  result = @mixins.to_hash
  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
end