Class: Elasticity::BootstrapAction

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticity/bootstrap_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(script, *bootstrap_arguments) ⇒ BootstrapAction

Returns a new instance of BootstrapAction.



9
10
11
12
13
# File 'lib/elasticity/bootstrap_action.rb', line 9

def initialize(script, *bootstrap_arguments)
  @name = 'Elasticity Bootstrap Action'
  @script = script
  @arguments = bootstrap_arguments
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



7
8
9
# File 'lib/elasticity/bootstrap_action.rb', line 7

def arguments
  @arguments
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/elasticity/bootstrap_action.rb', line 5

def name
  @name
end

#scriptObject

Returns the value of attribute script.



6
7
8
# File 'lib/elasticity/bootstrap_action.rb', line 6

def script
  @script
end

Instance Method Details

#to_aws_bootstrap_actionObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/elasticity/bootstrap_action.rb', line 15

def to_aws_bootstrap_action
  action = {
    :name => @name,
    :script_bootstrap_action => {
      :path => @script
    }
  }
  action[:script_bootstrap_action].merge!(:args => @arguments) unless @arguments.empty?
  action
end