Class: Ec2ssh::Ec2Instances::InstanceWrapper
- Inherits:
-
Object
- Object
- Ec2ssh::Ec2Instances::InstanceWrapper
- Defined in:
- lib/ec2ssh/ec2_instances.rb
Defined Under Namespace
Classes: TagsWrapper
Instance Method Summary collapse
-
#initialize(ec2_instance) ⇒ InstanceWrapper
constructor
A new instance of InstanceWrapper.
- #tag(key) ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(ec2_instance) ⇒ InstanceWrapper
Returns a new instance of InstanceWrapper.
35 36 37 38 |
# File 'lib/ec2ssh/ec2_instances.rb', line 35 def initialize(ec2_instance) @ec2_instance = ec2_instance @_tags ||= @ec2_instance..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 (private)
50 51 52 |
# File 'lib/ec2ssh/ec2_instances.rb', line 50 def method_missing(name, *args, &block) @ec2_instance.public_send(name, *args, &block) end |
Instance Method Details
#tag(key) ⇒ Object
40 41 42 |
# File 'lib/ec2ssh/ec2_instances.rb', line 40 def tag(key) @_tags[key] end |
#tags ⇒ Object
44 45 46 |
# File 'lib/ec2ssh/ec2_instances.rb', line 44 def TagsWrapper.new(super) end |