Class: Ec2ssh::Ec2Instances::InstanceWrapper
- Inherits:
-
Object
- Object
- Ec2ssh::Ec2Instances::InstanceWrapper
show all
- Defined in:
- lib/ec2ssh/ec2_instances.rb
Defined Under Namespace
Classes: TagsWrapper
Instance Method Summary
collapse
Constructor Details
37
38
39
40
|
# File 'lib/ec2ssh/ec2_instances.rb', line 37
def initialize(ec2_instance)
@ec2_instance = ec2_instance
@_tags ||= @ec2_instance.tags.each_with_object({}) {|t, h| h[t.key] = t.value }
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
52
53
54
|
# File 'lib/ec2ssh/ec2_instances.rb', line 52
def method_missing(name, *args, &block)
@ec2_instance.public_send(name, *args, &block)
end
|
Instance Method Details
#tag(key) ⇒ Object
42
43
44
|
# File 'lib/ec2ssh/ec2_instances.rb', line 42
def tag(key)
@_tags[key]
end
|
46
47
48
|
# File 'lib/ec2ssh/ec2_instances.rb', line 46
def tags
TagsWrapper.new(super)
end
|