Module: MtGox::Configuration
- Included in:
- Client
- Defined in:
- lib/mtgox/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
An array of valid keys in the options hash when configuring a MtGox::Client
[ :commission, :key, :secret, :nonce_type ]
- DEFAULT_COMMISSION =
BigDecimal('0.0065').freeze
- DEFAULT_NONCE_TYPE =
:nonce
Class Method Summary collapse
-
.extended(base) ⇒ Object
When this module is extended, set all configuration options to their default values.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
- #nonce_type ⇒ Object
-
#reset ⇒ Object
Reset all configuration options to defaults.
Class Method Details
.extended(base) ⇒ Object
When this module is extended, set all configuration options to their default values
20 21 22 |
# File 'lib/mtgox/configuration.rb', line 20 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
25 26 27 |
# File 'lib/mtgox/configuration.rb', line 25 def configure yield self end |
#nonce_type ⇒ Object
37 38 39 |
# File 'lib/mtgox/configuration.rb', line 37 def nonce_type @nonce_type || DEFAULT_NONCE_TYPE end |
#reset ⇒ Object
Reset all configuration options to defaults
30 31 32 33 34 35 |
# File 'lib/mtgox/configuration.rb', line 30 def reset self.commission = DEFAULT_COMMISSION self.key = nil self.secret = nil self end |