lib/yun/config.rb in yun-0.0.2 vs lib/yun/config.rb in yun-0.0.3
- old
+ new
@@ -1,27 +1,32 @@
require 'yaml'
module Yun
class Config
- def initialize
- @setting = YAML.load_file(config_file)[:default]
+ def self.aws_access_key_id
+ setting[:aws_access_key_id]
end
- def config_file
- @config_file ||= File.expand_path('~/.yun')
+ def self.aws_secret_access_key
+ setting[:aws_secret_access_key]
end
- def aws_access_key_id
- @setting[:aws_access_key_id]
+ def self.region
+ setting[:region]
end
- def aws_secret_access_key
- @setting[:aws_secret_access_key]
+ def self.key_name
+ setting[:key_name]
end
- def region
- @setting[:region]
+ private
+ def self.setting
+ @setting ||= YAML.load_file(config_file)[:default]
+ end
+
+ def self.config_file
+ @config_file ||= File.expand_path('~/.yun')
end
end
end