Module: Monkeylearn::Configurable
- Included in:
- Monkeylearn
- Defined in:
- lib/monkeylearn/configurable.rb
Instance Attribute Summary collapse
-
#auto_batch ⇒ Object
Returns the value of attribute auto_batch.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#retry_if_throttle ⇒ Object
Returns the value of attribute retry_if_throttle.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#auto_batch ⇒ Object
Returns the value of attribute auto_batch.
5 6 7 |
# File 'lib/monkeylearn/configurable.rb', line 5 def auto_batch @auto_batch end |
#base_url ⇒ Object
Returns the value of attribute base_url.
5 6 7 |
# File 'lib/monkeylearn/configurable.rb', line 5 def base_url @base_url end |
#retry_if_throttle ⇒ Object
Returns the value of attribute retry_if_throttle.
5 6 7 |
# File 'lib/monkeylearn/configurable.rb', line 5 def retry_if_throttle @retry_if_throttle 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 16 |
# File 'lib/monkeylearn/configurable.rb', line 9 def keys @keys ||= [ :base_url, :token, :retry_if_throttle, :auto_batch, ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
19 20 21 |
# File 'lib/monkeylearn/configurable.rb', line 19 def configure yield self end |
#reset! ⇒ Object
23 24 25 26 27 28 |
# File 'lib/monkeylearn/configurable.rb', line 23 def reset! Monkeylearn::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Monkeylearn::Defaults.[key]) end self end |