Class: Ec2ssh::Ec2Instances::InstanceWrapper::TagsWrapper

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

Instance Method Summary collapse

Constructor Details

#initialize(tags) ⇒ TagsWrapper

Returns a new instance of TagsWrapper.



11
12
13
# File 'lib/ec2ssh/ec2_instances.rb', line 11

def initialize(tags)
  @tags = tags
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)



28
29
30
# File 'lib/ec2ssh/ec2_instances.rb', line 28

def method_missing(name, *args, &block)
  @tags.public_send(name, *args, &block)
end

Instance Method Details

#[](key) ⇒ Object

simulate



16
17
18
19
20
21
22
23
24
# File 'lib/ec2ssh/ec2_instances.rb', line 16

def [](key)
  if key.is_a? ::String
    raise DotfileValidationError, <<-MSG
`tags[String]` syntax in the dotfile has been deleted since v4.0. Use `tag(String)` instead.
See: https://github.com/mirakui/ec2ssh#how-to-upgrade-from-3x
    MSG
  end
  super
end