Class: Zotero::HTTPConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/zotero/http_config.rb

Overview

Configuration for HTTP requests

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(open_timeout: 30, read_timeout: 60, verify_ssl: true) ⇒ HTTPConfig

Returns a new instance of HTTPConfig.



8
9
10
11
12
# File 'lib/zotero/http_config.rb', line 8

def initialize(open_timeout: 30, read_timeout: 60, verify_ssl: true)
  @open_timeout = open_timeout
  @read_timeout = read_timeout
  @verify_ssl = verify_ssl
end

Instance Attribute Details

#open_timeoutObject

Returns the value of attribute open_timeout.



6
7
8
# File 'lib/zotero/http_config.rb', line 6

def open_timeout
  @open_timeout
end

#read_timeoutObject

Returns the value of attribute read_timeout.



6
7
8
# File 'lib/zotero/http_config.rb', line 6

def read_timeout
  @read_timeout
end

#verify_sslObject

Returns the value of attribute verify_ssl.



6
7
8
# File 'lib/zotero/http_config.rb', line 6

def verify_ssl
  @verify_ssl
end

Class Method Details

.configure {|default| ... } ⇒ Object

Yields:



18
19
20
21
# File 'lib/zotero/http_config.rb', line 18

def self.configure
  yield(default) if block_given?
  default
end

.defaultObject



14
15
16
# File 'lib/zotero/http_config.rb', line 14

def self.default
  @default ||= new
end