Class: Ec2Meta::ApiLoader

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

Class Method Summary collapse

Class Method Details

.api_module(api_version) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/ec2_meta/loader.rb', line 7

def self.api_module(api_version)
  raise 'require valid api_version' if api_version.nil? || api_version.empty?

  api_namespace = Ec2Meta.const_get('Api' + api_version.delete('-'))
  api_namespace.const_get('Base')
rescue NameError
  raise NotSupported, "Not Supported the api_version: #{api_version}"
end