Class: Sinew::RuntimeOptions
Instance Attribute Summary collapse
-
#before_generate_cache_key ⇒ Object
Returns the value of attribute before_generate_cache_key.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#httparty_options ⇒ Object
Returns the value of attribute httparty_options.
-
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
-
#retries ⇒ Object
Returns the value of attribute retries.
Instance Method Summary collapse
-
#initialize ⇒ RuntimeOptions
constructor
A new instance of RuntimeOptions.
Constructor Details
#initialize ⇒ RuntimeOptions
Returns a new instance of RuntimeOptions.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sinew/runtime_options.rb', line 13 def initialize self.retries = 3 self.rate_limit = 1 self.headers = { 'User-Agent' => "sinew/#{VERSION}", } self. = {} self.before_generate_cache_key = ->(i) { i } # for testing if ENV['SINEW_TEST'] self.rate_limit = 0 end end |
Instance Attribute Details
#before_generate_cache_key ⇒ Object
Returns the value of attribute before_generate_cache_key.
11 12 13 |
# File 'lib/sinew/runtime_options.rb', line 11 def before_generate_cache_key @before_generate_cache_key end |
#headers ⇒ Object
Returns the value of attribute headers.
9 10 11 |
# File 'lib/sinew/runtime_options.rb', line 9 def headers @headers end |
#httparty_options ⇒ Object
Returns the value of attribute httparty_options.
10 11 12 |
# File 'lib/sinew/runtime_options.rb', line 10 def @httparty_options end |
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
8 9 10 |
# File 'lib/sinew/runtime_options.rb', line 8 def rate_limit @rate_limit end |
#retries ⇒ Object
Returns the value of attribute retries.
7 8 9 |
# File 'lib/sinew/runtime_options.rb', line 7 def retries @retries end |