Module: Bitsor::Configurable
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/bitsor/concerns/configurable.rb', line 5 def api_key @api_key end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
5 6 7 |
# File 'lib/bitsor/concerns/configurable.rb', line 5 def api_secret @api_secret end |
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/bitsor/concerns/configurable.rb', line 5 def client_id @client_id end |
Class Method Details
.keys ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/bitsor/concerns/configurable.rb', line 8 def keys @keys ||= [ :client_id, :api_key, :api_secret, ] end |
Instance Method Details
#api_endpoint ⇒ Object
30 31 32 |
# File 'lib/bitsor/concerns/configurable.rb', line 30 def api_endpoint File.join(@api_endpoint, '') end |
#configure {|_self| ... } ⇒ Object
17 18 19 |
# File 'lib/bitsor/concerns/configurable.rb', line 17 def configure yield self end |
#reset! ⇒ Object Also known as: setup
21 22 23 24 25 26 27 |
# File 'lib/bitsor/concerns/configurable.rb', line 21 def reset! Bitsor::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Bitsor::Default.[key]) end @last_response = nil self end |