Class: Megam::Mixins::CommonDeployable
- Inherits:
-
Object
- Object
- Megam::Mixins::CommonDeployable
- Includes:
- Nilavu::MegamAttributes
- Defined in:
- lib/megam/mixins/common_deployable.rb
Constant Summary collapse
- DEFAULT_TOSCA_PREFIX =
'tosca'.freeze
- DEFAULT_TOSCA_SUFFIX =
this is a mutable string, if nothing exists then we use ubuntu
'ubuntu'.freeze
- ATTRIBUTES =
[ :assemblyname, :componentname, :tosca_type, :status, :inputs]
Constants included from Nilavu::MegamAttributes
Nilavu::MegamAttributes::KEY, Nilavu::MegamAttributes::VALUE
Instance Attribute Summary collapse
-
#assemblyname ⇒ Object
readonly
Returns the value of attribute assemblyname.
-
#componentname ⇒ Object
readonly
Returns the value of attribute componentname.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tosca_type ⇒ Object
readonly
Returns the value of attribute tosca_type.
Instance Method Summary collapse
- #attributes ⇒ Object
- #bld_toscatype(mkp) ⇒ Object
-
#initialize(params) ⇒ CommonDeployable
constructor
A new instance of CommonDeployable.
- #to_hash ⇒ Object
Methods included from Nilavu::MegamAttributes
Constructor Details
#initialize(params) ⇒ CommonDeployable
Returns a new instance of CommonDeployable.
23 24 25 26 27 28 29 30 |
# File 'lib/megam/mixins/common_deployable.rb', line 23 def initialize(params) @assemblyname = "" @tosca_type = "" @status = "launching" bld_toscatype(params) @inputs = InputGroupData.new(params) set_attributes(params) end |
Instance Attribute Details
#assemblyname ⇒ Object (readonly)
Returns the value of attribute assemblyname.
7 8 9 |
# File 'lib/megam/mixins/common_deployable.rb', line 7 def assemblyname @assemblyname end |
#componentname ⇒ Object (readonly)
Returns the value of attribute componentname.
7 8 9 |
# File 'lib/megam/mixins/common_deployable.rb', line 7 def componentname @componentname end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
7 8 9 |
# File 'lib/megam/mixins/common_deployable.rb', line 7 def inputs @inputs end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/megam/mixins/common_deployable.rb', line 7 def status @status end |
#tosca_type ⇒ Object (readonly)
Returns the value of attribute tosca_type.
7 8 9 |
# File 'lib/megam/mixins/common_deployable.rb', line 7 def tosca_type @tosca_type end |
Instance Method Details
#attributes ⇒ Object
20 21 22 |
# File 'lib/megam/mixins/common_deployable.rb', line 20 def attributes ATTRIBUTES end |
#bld_toscatype(mkp) ⇒ Object
42 43 44 45 46 |
# File 'lib/megam/mixins/common_deployable.rb', line 42 def bld_toscatype(mkp) tosca_suffix = DEFAULT_TOSCA_SUFFIX tosca_suffix = "#{mkp[:mkp_name]}" unless mkp[:cattype] != 'TORPEDO'.freeze @tosca_type = DEFAULT_TOSCA_PREFIX + ".#{mkp[:cattype].downcase}.#{mkp[:mkp_name].downcase}" end |
#to_hash ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/megam/mixins/common_deployable.rb', line 33 def to_hash h = { :name => assemblyname, :status => status, :tosca_type => tosca_type, :inputs => inputs.to_hash } end |