Class: Spectro::Config
- Inherits:
-
Object
- Object
- Spectro::Config
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/spectro/config.rb
Constant Summary collapse
- API_HOSTNAME =
'localhost:9292'
Instance Attribute Summary collapse
-
#mocks_enabled ⇒ Object
Returns the value of attribute mocks_enabled.
Instance Method Summary collapse
-
#api_hostname ⇒ String
Returns the API Hostname from the config or the default if missin.
-
#api_hostname=(hostname) ⇒ String|NilClass
Sets a custom API Hostname.
-
#enable_mocks! ⇒ Spectro::Config
Sets mocks_enabled to true.
-
#mocks_enabled? ⇒ TrueClass, FalseClass
Returns the current mocks policy (enabled or disabled).
Instance Attribute Details
#mocks_enabled ⇒ Object
Returns the value of attribute mocks_enabled.
7 8 9 |
# File 'lib/spectro/config.rb', line 7 def mocks_enabled @mocks_enabled end |
Instance Method Details
#api_hostname ⇒ String
Returns the API Hostname from the config or the default if missin
20 21 22 |
# File 'lib/spectro/config.rb', line 20 def api_hostname return @api_hostname || API_HOSTNAME end |
#api_hostname=(hostname) ⇒ String|NilClass
Sets a custom API Hostname
28 29 30 |
# File 'lib/spectro/config.rb', line 28 def api_hostname= hostname @api_hostname = hostname end |
#enable_mocks! ⇒ Spectro::Config
Sets mocks_enabled to true
35 36 37 38 |
# File 'lib/spectro/config.rb', line 35 def enable_mocks! self.mocks_enabled = true return self end |
#mocks_enabled? ⇒ TrueClass, FalseClass
Returns the current mocks policy (enabled or disabled)
43 44 45 |
# File 'lib/spectro/config.rb', line 43 def mocks_enabled? return !!self.mocks_enabled end |