Class: Ec2Tools

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

Defined Under Namespace

Modules: Config Classes: EC2

Instance Method Summary collapse

Constructor Details

#initialize(config_file = nil) ⇒ Ec2Tools

Returns a new instance of Ec2Tools.



7
8
9
# File 'lib/ec2_tools.rb', line 7

def initialize(config_file = nil)
  @ec2 = EC2.new(Config.load(config_file))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



11
12
13
14
15
16
# File 'lib/ec2_tools.rb', line 11

def method_missing(name, *args)
  define_method(:name) do |_args|
    @ec2.send(name, _args)
  end
  self.send(name, args)
end

Instance Method Details

#inspectObject



18
19
20
# File 'lib/ec2_tools.rb', line 18

def inspect
  "#<Ec2Tools>"
end