class Magellan::Gcs::Proxy::Config
Attributes
path[R]
Public Class Methods
new(path = './config.yml')
click to toggle source
# File lib/magellan/gcs/proxy/config.rb, line 12 def initialize(path = './config.yml') @path = path end
Public Instance Methods
[](key)
click to toggle source
# File lib/magellan/gcs/proxy/config.rb, line 34 def [](key) data[key.to_s] end
data()
click to toggle source
# File lib/magellan/gcs/proxy/config.rb, line 16 def data @data ||= load_file end
load_file()
click to toggle source
# File lib/magellan/gcs/proxy/config.rb, line 24 def load_file erb = ERB.new(File.read(path), nil, '-') erb.filename = path t = erb.result puts '=' * 100 puts t puts '-' * 100 YAML.load(t) end
reset()
click to toggle source
# File lib/magellan/gcs/proxy/config.rb, line 20 def reset @data = nil end
verbose?()
click to toggle source
# File lib/magellan/gcs/proxy/config.rb, line 38 def verbose? ENV['VERBOSE'] =~ /true|yes|on|1/i end