Sha256: feefd6f21d6ed3067543a09a0abd10d96ee938a441583f6e729fdb63e3c29834
Contents?: true
Size: 916 Bytes
Versions: 12
Compression:
Stored size: 916 Bytes
Contents
require 'mtgox/version' module MtGox module Configuration # An array of valid keys in the options hash when configuring a {MtGox::Client} VALID_OPTIONS_KEYS = [ :commission, :key, :secret, ] DEFAULT_COMMISSION = 0.0065.freeze attr_accessor *VALID_OPTIONS_KEYS # When this module is extended, set all configuration options to their default values def self.extended(base) base.reset end # Convenience method to allow configuration options to be set in a block def configure yield self end # Create a hash of options and their values def options options = {} VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)} options end # Reset all configuration options to defaults def reset self.commission = DEFAULT_COMMISSION self.key = nil self.secret = nil self end end end
Version data entries
12 entries across 12 versions & 2 rubygems