Module: Monkeylearn::Configurable

Included in:
Monkeylearn
Defined in:
lib/monkeylearn/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



5
6
7
# File 'lib/monkeylearn/configurable.rb', line 5

def api_endpoint
  @api_endpoint
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/monkeylearn/configurable.rb', line 5

def token
  @token
end

Class Method Details

.keysObject



9
10
11
12
13
14
15
# File 'lib/monkeylearn/configurable.rb', line 9

def keys
  @keys ||= [
    :api_endpoint,
    :token,
    :wait_on_throttle
  ]
end

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:



18
19
20
# File 'lib/monkeylearn/configurable.rb', line 18

def configure
  yield self
end

#reset!Object



22
23
24
25
26
27
# File 'lib/monkeylearn/configurable.rb', line 22

def reset!
  Monkeylearn::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", Monkeylearn::Defaults.options[key])
  end
  self
end

#wait_on_throttleObject



29
30
31
# File 'lib/monkeylearn/configurable.rb', line 29

def wait_on_throttle
  @wait_on_throttle
end