module Bitshares

stackoverflow.com/questions/6233124/where-to-place-access-config-file-in-gem

Constants

CHAIN
CLIENT
VERSION

Public Class Methods

config() click to toggle source
# File lib/bitshares.rb, line 44
def self.config
  @config
end
configure(opts = {}) click to toggle source
# File lib/bitshares.rb, line 26
def self.configure(opts = {})
  opts.each {|k,v| @config[k.to_sym] = v if @valid_keys.include? k.to_sym}
end
configure_with(path_to_yaml_file) click to toggle source
# File lib/bitshares.rb, line 30
def self.configure_with(path_to_yaml_file)
  begin
    config = YAML::load(IO.read(path_to_yaml_file))
  rescue Errno::ENOENT
    puts "YAML configuration file couldn\'t be found. Using defaults"
    return
  rescue Psych::SyntaxError
    puts 'YAML configuration file contains invalid syntax. Using defaults'
    return
  end

  configure(config)
end