class VpsbClient::Config

Public Class Methods

new(path) click to toggle source
# File lib/vpsb_client/config.rb, line 5
def initialize(path)
  raise ArgumentError, "Can't find #{path}" unless File.exist?(path)
  @yml = YAML.load_file(path)
end

Public Instance Methods

[](name) click to toggle source
# File lib/vpsb_client/config.rb, line 14
def [](name)
  fetch(name.to_s)
end
fetch(name, default=nil) click to toggle source
# File lib/vpsb_client/config.rb, line 10
def fetch(name, default=nil)
  default ? @yml.fetch(name.to_s, default) : @yml.fetch(name.to_s)
end