Module: Bitsor::Configurable

Included in:
Bitsor, Client
Defined in:
lib/bitsor/concerns/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

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_secretObject

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_idObject

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

.keysObject



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_endpointObject



30
31
32
# File 'lib/bitsor/concerns/configurable.rb', line 30

def api_endpoint
  File.join(@api_endpoint, '')
end

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



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.options[key])
  end
  @last_response = nil
  self
end