Class: OptimisClient::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/optimis_client/base.rb

Constant Summary collapse

DEFAULT_TIMEOUT =

10s

10*1000
@@hydra =
Typhoeus::Hydra.new

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



18
19
20
# File 'lib/optimis_client/base.rb', line 18

def api_key
  @api_key
end

.hostObject

Returns the value of attribute host.



18
19
20
# File 'lib/optimis_client/base.rb', line 18

def host
  @host
end

.secureObject

Returns the value of attribute secure.



18
19
20
# File 'lib/optimis_client/base.rb', line 18

def secure
  @secure
end

.timeoutObject

Returns the value of attribute timeout.



18
19
20
# File 'lib/optimis_client/base.rb', line 18

def timeout
  @timeout
end

Class Method Details

.http_protocolObject



37
38
39
# File 'lib/optimis_client/base.rb', line 37

def http_protocol
  (self.secure)? "https://" : "http://"
end

.hydraObject



20
21
22
# File 'lib/optimis_client/base.rb', line 20

def hydra
  @@hydra
end

.hydra_run_allObject



41
42
43
# File 'lib/optimis_client/base.rb', line 41

def hydra_run_all
  self.hydra.run unless self.stubbed?
end

.stubbed=(value) ⇒ Object



28
29
30
# File 'lib/optimis_client/base.rb', line 28

def stubbed=(value)
  @stubbed = value
end

.stubbed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/optimis_client/base.rb', line 24

def stubbed?
  !!@stubbed
end