Class: DefraRubyMocks::Configuration
- Inherits:
-
Object
- Object
- DefraRubyMocks::Configuration
- Defined in:
- lib/defra_ruby_mocks/configuration.rb
Constant Summary collapse
- DEFAULT_DELAY =
1000
Instance Attribute Summary collapse
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#govpay_mocks_external_root_url ⇒ Object
Returns the value of attribute govpay_mocks_external_root_url.
-
#govpay_mocks_external_root_url_other ⇒ Object
Returns the value of attribute govpay_mocks_external_root_url_other.
-
#govpay_mocks_internal_root_url ⇒ Object
Returns the value of attribute govpay_mocks_internal_root_url.
-
#govpay_mocks_internal_root_url_other ⇒ Object
Returns the value of attribute govpay_mocks_internal_root_url_other.
Instance Method Summary collapse
-
#enable=(arg) ⇒ Object
Controls whether the mocks are enabled.
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 14 def initialize @enable = false @delay = DEFAULT_DELAY end |
Instance Attribute Details
#delay ⇒ Object
Returns the value of attribute delay.
12 13 14 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 12 def delay @delay end |
#govpay_mocks_external_root_url ⇒ Object
Returns the value of attribute govpay_mocks_external_root_url.
8 9 10 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 8 def govpay_mocks_external_root_url @govpay_mocks_external_root_url end |
#govpay_mocks_external_root_url_other ⇒ Object
Returns the value of attribute govpay_mocks_external_root_url_other.
8 9 10 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 8 def govpay_mocks_external_root_url_other @govpay_mocks_external_root_url_other end |
#govpay_mocks_internal_root_url ⇒ Object
Returns the value of attribute govpay_mocks_internal_root_url.
8 9 10 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 8 def govpay_mocks_internal_root_url @govpay_mocks_internal_root_url end |
#govpay_mocks_internal_root_url_other ⇒ Object
Returns the value of attribute govpay_mocks_internal_root_url_other.
8 9 10 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 8 def govpay_mocks_internal_root_url_other @govpay_mocks_internal_root_url_other end |
Instance Method Details
#enable=(arg) ⇒ Object
Controls whether the mocks are enabled. Only if set to true will the mock pages be accessible
21 22 23 24 25 26 27 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 21 def enable=(arg) # We implement our own setter to handle values being passed in as strings # rather than booleans parsed = arg.to_s.downcase @enable = parsed == "true" end |
#enabled? ⇒ Boolean
29 30 31 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 29 def enabled? @enable end |