Class: Aspera::RestParameters
- Inherits:
-
Object
- Object
- Aspera::RestParameters
- Includes:
- Singleton
- Defined in:
- lib/aspera/rest.rb
Overview
Global settings for Rest object
For example to remove certificate verification globally:
RestParameters.instance.session_cb = lambda{|http|http.verify_mode=OpenSSL::SSL::VERIFY_NONE}
Instance Attribute Summary collapse
-
#download_partial_suffix ⇒ Object
Returns the value of attribute download_partial_suffix.
-
#progress_bar ⇒ Object
Returns the value of attribute progress_bar.
-
#retry_max ⇒ Object
Returns the value of attribute retry_max.
-
#retry_on_error ⇒ Object
Returns the value of attribute retry_on_error.
-
#retry_on_timeout ⇒ Object
Returns the value of attribute retry_on_timeout.
-
#retry_on_unavailable ⇒ Object
Returns the value of attribute retry_on_unavailable.
-
#retry_sleep ⇒ Object
Returns the value of attribute retry_sleep.
-
#session_cb ⇒ Object
Returns the value of attribute session_cb.
-
#spinner_cb ⇒ Object
Returns the value of attribute spinner_cb.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Class Method Summary collapse
-
.instance ⇒ RestParameters
Returns the singleton instance of RestParameters.
Instance Attribute Details
#download_partial_suffix ⇒ Object
Returns the value of attribute download_partial_suffix.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def download_partial_suffix @download_partial_suffix end |
#progress_bar ⇒ Object
Returns the value of attribute progress_bar.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def @progress_bar end |
#retry_max ⇒ Object
Returns the value of attribute retry_max.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def retry_max @retry_max end |
#retry_on_error ⇒ Object
Returns the value of attribute retry_on_error.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def retry_on_error @retry_on_error end |
#retry_on_timeout ⇒ Object
Returns the value of attribute retry_on_timeout.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def retry_on_timeout @retry_on_timeout end |
#retry_on_unavailable ⇒ Object
Returns the value of attribute retry_on_unavailable.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def retry_on_unavailable @retry_on_unavailable end |
#retry_sleep ⇒ Object
Returns the value of attribute retry_sleep.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def retry_sleep @retry_sleep end |
#session_cb ⇒ Object
Returns the value of attribute session_cb.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def session_cb @session_cb end |
#spinner_cb ⇒ Object
Returns the value of attribute spinner_cb.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def spinner_cb @spinner_cb end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
40 41 42 |
# File 'lib/aspera/rest.rb', line 40 def user_agent @user_agent end |
Class Method Details
.instance ⇒ RestParameters
Returns the singleton instance of RestParameters
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/aspera/rest.rb', line 37 class RestParameters include Singleton attr_accessor :user_agent, :download_partial_suffix, :retry_on_error, :retry_on_timeout, :retry_on_unavailable, :retry_max, :retry_sleep, :session_cb, :progress_bar, :spinner_cb private def initialize @user_agent = 'RubyAsperaRest' @download_partial_suffix = '.http_partial' @retry_on_error = false @retry_on_timeout = true @retry_on_unavailable = true @retry_max = 1 @retry_sleep = 4 @session_cb = nil @progress_bar = nil @spinner_cb = nil end end |