Module: Monkeylearn::Configurable
- Included in:
- Monkeylearn
- Defined in:
- lib/monkeylearn/configurable.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
5 6 7 |
# File 'lib/monkeylearn/configurable.rb', line 5 def api_endpoint @api_endpoint end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/monkeylearn/configurable.rb', line 5 def token @token end |
Class Method Details
.keys ⇒ Object
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
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.[key]) end self end |
#wait_on_throttle ⇒ Object
29 30 31 |
# File 'lib/monkeylearn/configurable.rb', line 29 def wait_on_throttle @wait_on_throttle end |