Class: OpenCPU::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/opencpu/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
# File 'lib/opencpu/configuration.rb', line 11

def initialize
  @fake_responses = {}
  @verify_ssl     = true
end

Instance Attribute Details

#endpoint_urlObject

Returns the value of attribute endpoint_url.



3
4
5
# File 'lib/opencpu/configuration.rb', line 3

def endpoint_url
  @endpoint_url
end

#fake_responsesObject

Returns the value of attribute fake_responses.



8
9
10
# File 'lib/opencpu/configuration.rb', line 8

def fake_responses
  @fake_responses
end

#modeObject

Returns the value of attribute mode.



7
8
9
# File 'lib/opencpu/configuration.rb', line 7

def mode
  @mode
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/opencpu/configuration.rb', line 6

def password
  @password
end

#timeoutObject

Returns the value of attribute timeout.



4
5
6
# File 'lib/opencpu/configuration.rb', line 4

def timeout
  @timeout
end

#usernameObject

Returns the value of attribute username.



5
6
7
# File 'lib/opencpu/configuration.rb', line 5

def username
  @username
end

#verify_sslObject

Returns the value of attribute verify_ssl.



9
10
11
# File 'lib/opencpu/configuration.rb', line 9

def verify_ssl
  @verify_ssl
end

Instance Method Details

#add_fake_response(key, response) ⇒ Object



16
17
18
# File 'lib/opencpu/configuration.rb', line 16

def add_fake_response(key, response)
  @fake_responses[key] = response
end

#remove_fake_response(key) ⇒ Object



20
21
22
# File 'lib/opencpu/configuration.rb', line 20

def remove_fake_response(key)
  @fake_responses.delete key
end

#reset!Object



24
25
26
27
28
29
30
31
32
# File 'lib/opencpu/configuration.rb', line 24

def reset!
  @endpoint_url   = nil
  @timeout        = nil
  @username       = nil
  @password       = nil
  @mode           = nil
  @verify_ssl     = true
  @fake_responses = {}
end