Class: Aspera::RestParameters

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Attribute Details

#download_partial_suffixObject

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_barObject

Returns the value of attribute progress_bar.



40
41
42
# File 'lib/aspera/rest.rb', line 40

def progress_bar
  @progress_bar
end

#retry_maxObject

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_errorObject

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_timeoutObject

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_unavailableObject

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_sleepObject

Returns the value of attribute retry_sleep.



40
41
42
# File 'lib/aspera/rest.rb', line 40

def retry_sleep
  @retry_sleep
end

#session_cbObject

Returns the value of attribute session_cb.



40
41
42
# File 'lib/aspera/rest.rb', line 40

def session_cb
  @session_cb
end

#spinner_cbObject

Returns the value of attribute spinner_cb.



40
41
42
# File 'lib/aspera/rest.rb', line 40

def spinner_cb
  @spinner_cb
end

#user_agentObject

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

.instanceRestParameters

Returns the singleton instance of RestParameters

Returns:



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