Class: Ec2Starter::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/ec2-starter/starter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ami_id, service_options, options) ⇒ Instance

Returns a new instance of Instance.



13
14
15
16
17
18
19
20
# File 'lib/ec2-starter/starter.rb', line 13

def initialize(ami_id, service_options, options)
  @ami_id = ami_id.to_s
  @ips = []
  @volumes = []
  @commands = []
  @default_options = {}.merge(options)
  @service_options = {}.merge(service_options)
end

Instance Attribute Details

#ami_idObject

Returns the value of attribute ami_id.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def ami_id
  @ami_id
end

#commandsObject

Returns the value of attribute commands.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def commands
  @commands
end

#default_optionsObject

Returns the value of attribute default_options.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def default_options
  @default_options
end

#instance_idObject

Returns the value of attribute instance_id.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def instance_id
  @instance_id
end

#ipsObject

Returns the value of attribute ips.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def ips
  @ips
end

#service_optionsObject

Returns the value of attribute service_options.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def service_options
  @service_options
end

#volumesObject

Returns the value of attribute volumes.



11
12
13
# File 'lib/ec2-starter/starter.rb', line 11

def volumes
  @volumes
end

Instance Method Details

#command(command) ⇒ Object



30
31
32
# File 'lib/ec2-starter/starter.rb', line 30

def command(command)
  @commands << command
end

#ip(ip_address) ⇒ Object



22
23
24
# File 'lib/ec2-starter/starter.rb', line 22

def ip(ip_address)
  @ips << ip_address
end

#volume(volume_hash) ⇒ Object



26
27
28
# File 'lib/ec2-starter/starter.rb', line 26

def volume(volume_hash)
  @volumes << volume_hash
end