Class: AWS::EC2::Instance

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_hash = {}) ⇒ Instance

Returns a new instance of Instance.



7
8
9
10
11
# File 'lib/instance.rb', line 7

def initialize(init_hash = {})
  init_hash.each do |k, v|
    self.send(k.to_s + "=", v) unless !self.respond_to?(k.to_s + "=")
  end
end

Instance Attribute Details

#instance_idObject

Returns the value of attribute instance_id.



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

def instance_id
  @instance_id
end

#launch_timeObject

Returns the value of attribute launch_time.



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

def launch_time
  @launch_time
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#tagsObject

Returns the value of attribute tags.



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

def tags
  @tags
end

Instance Method Details

#match?(tag) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/instance.rb', line 13

def match?(tag)
  self.tags.detect { |k, v| v.to_s.match /#{tag}/ }
end