Class: BSClient::Config

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/bsclient/config.rb

Class Method Summary collapse

Class Method Details

.create(env, file = nil) ⇒ Object



8
9
10
11
12
13
# File 'lib/bsclient/config.rb', line 8

def create(env, file = nil)
  file ||= File.expand_path('~/.bsclient.yml')
  yaml = YAML.load(File.read(file)) || {}
  conf = yaml[env] || {}
  new(OpenStruct.new(conf))
end