Class: OptimisClient::Base
- Inherits:
-
Object
- Object
- OptimisClient::Base
- Defined in:
- lib/optimis_client/base.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
10s
10*1000
- @@hydra =
Typhoeus::Hydra.new
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.host ⇒ Object
Returns the value of attribute host.
-
.secure ⇒ Object
Returns the value of attribute secure.
-
.timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
- .http_protocol ⇒ Object
- .hydra ⇒ Object
- .hydra_run_all ⇒ Object
- .stubbed=(value) ⇒ Object
- .stubbed? ⇒ Boolean
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
18 19 20 |
# File 'lib/optimis_client/base.rb', line 18 def api_key @api_key end |
.host ⇒ Object
Returns the value of attribute host.
18 19 20 |
# File 'lib/optimis_client/base.rb', line 18 def host @host end |
.secure ⇒ Object
Returns the value of attribute secure.
18 19 20 |
# File 'lib/optimis_client/base.rb', line 18 def secure @secure end |
.timeout ⇒ Object
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_protocol ⇒ Object
37 38 39 |
# File 'lib/optimis_client/base.rb', line 37 def http_protocol (self.secure)? "https://" : "http://" end |
.hydra ⇒ Object
20 21 22 |
# File 'lib/optimis_client/base.rb', line 20 def hydra @@hydra end |
.hydra_run_all ⇒ Object
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
24 25 26 |
# File 'lib/optimis_client/base.rb', line 24 def stubbed? !!@stubbed end |