Module: Browser::Options

Included in:
Browser
Defined in:
lib/common/browser/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#basic_authObject

Returns the value of attribute basic_auth


7
8
9
# File 'lib/common/browser/options.rb', line 7

def basic_auth
  @basic_auth
end

#cache_ttlObject

Returns the value of attribute cache_ttl


6
7
8
# File 'lib/common/browser/options.rb', line 6

def cache_ttl
  @cache_ttl
end

#connect_timeoutObject

Returns the value of attribute connect_timeout


6
7
8
# File 'lib/common/browser/options.rb', line 6

def connect_timeout
  @connect_timeout
end

#proxyObject

Returns the value of attribute proxy


7
8
9
# File 'lib/common/browser/options.rb', line 7

def proxy
  @proxy
end

#proxy_authObject

Returns the value of attribute proxy_auth


7
8
9
# File 'lib/common/browser/options.rb', line 7

def proxy_auth
  @proxy_auth
end

#request_timeoutObject

Returns the value of attribute request_timeout


6
7
8
# File 'lib/common/browser/options.rb', line 6

def request_timeout
  @request_timeout
end

#user_agent=(value) ⇒ Object (writeonly)

Sets the attribute user_agent


8
9
10
# File 'lib/common/browser/options.rb', line 8

def user_agent=(value)
  @user_agent = value
end

Instance Method Details

#max_threadsInteger


29
30
31
# File 'lib/common/browser/options.rb', line 29

def max_threads
  @max_threads || 1
end

#max_threads=(threads) ⇒ Object


33
34
35
36
37
38
39
40
# File 'lib/common/browser/options.rb', line 33

def max_threads=(threads)
  if threads.is_a?(Integer) && threads > 0
    @max_threads = threads
    @hydra = Typhoeus::Hydra.new(max_concurrency: threads)
  else
    raise 'max_threads must be an Integer > 0'
  end
end