Class: AwsEc2::Config

Inherits:
Base
  • Object
show all
Defined in:
lib/aws_ec2/config.rb

Constant Summary collapse

@@data =
nil

Constants inherited from Base

Base::BUILD_ROOT, Base::SCRIPTS_INFO_PATH

Instance Method Summary collapse

Methods inherited from Base

#derandomize, #randomize

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



5
6
7
8
# File 'lib/aws_ec2/config.rb', line 5

def initialize(options={})
  super
  @path = options[:path] || "#{AwsEc2.root}/config/#{AwsEc2.env}.yml"
end

Instance Method Details

#dataObject



11
12
13
14
15
16
17
18
# File 'lib/aws_ec2/config.rb', line 11

def data
  return @@data if @@data
  @@data = YAML.load_file(@path)
rescue Errno::ENOENT => e
  puts e.message
  puts "The #{@path} does not exist. Please double check that it exists."
  exit
end