Class: Megam::Mixins::CommonDeployable

Inherits:
Object
  • Object
show all
Includes:
Nilavu::MegamAttributes
Defined in:
lib/megam/mixins/common_deployable.rb

Constant Summary collapse

ATTRIBUTES =
[
    :status,
    :state,
:inputs]

Constants included from Nilavu::MegamAttributes

Nilavu::MegamAttributes::KEY, Nilavu::MegamAttributes::VALUE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Nilavu::MegamAttributes

#set_attributes

Constructor Details

#initialize(params) ⇒ CommonDeployable

Returns a new instance of CommonDeployable.



17
18
19
20
21
22
23
# File 'lib/megam/mixins/common_deployable.rb', line 17

def initialize(params)
    @status = 'initialized'
    @state = 'initialized'
    set_attributes(params)
    @inputs = InputGroupData.new(params)

end

Instance Attribute Details

#inputsObject (readonly)

Returns the value of attribute inputs.



7
8
9
# File 'lib/megam/mixins/common_deployable.rb', line 7

def inputs
  @inputs
end

#stateObject (readonly)

Returns the value of attribute state.



7
8
9
# File 'lib/megam/mixins/common_deployable.rb', line 7

def state
  @state
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/megam/mixins/common_deployable.rb', line 7

def status
  @status
end

Instance Method Details

#attributesObject



13
14
15
# File 'lib/megam/mixins/common_deployable.rb', line 13

def attributes
    ATTRIBUTES
end

#to_hashObject



25
26
27
28
29
30
31
# File 'lib/megam/mixins/common_deployable.rb', line 25

def to_hash
    h = {
        status: status,
        state: state,
        inputs: inputs.to_hash
    }
end