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.
-
#worldpay_admin_code ⇒ Object
Returns the value of attribute worldpay_admin_code.
-
#worldpay_domain ⇒ Object
Returns the value of attribute worldpay_domain.
-
#worldpay_mac_secret ⇒ Object
Returns the value of attribute worldpay_mac_secret.
-
#worldpay_merchant_code ⇒ Object
Returns the value of attribute worldpay_merchant_code.
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
12 13 14 15 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 12 def initialize @enable = false @delay = DEFAULT_DELAY end |
Instance Attribute Details
#delay ⇒ Object
Returns the value of attribute delay.
10 11 12 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 10 def delay @delay end |
#worldpay_admin_code ⇒ Object
Returns the value of attribute worldpay_admin_code.
8 9 10 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 8 def worldpay_admin_code @worldpay_admin_code end |
#worldpay_domain ⇒ Object
Returns the value of attribute worldpay_domain.
9 10 11 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 9 def worldpay_domain @worldpay_domain end |
#worldpay_mac_secret ⇒ Object
Returns the value of attribute worldpay_mac_secret.
8 9 10 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 8 def worldpay_mac_secret @worldpay_mac_secret end |
#worldpay_merchant_code ⇒ Object
Returns the value of attribute worldpay_merchant_code.
9 10 11 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 9 def worldpay_merchant_code @worldpay_merchant_code end |
Instance Method Details
#enable=(arg) ⇒ Object
Controls whether the mocks are enabled. Only if set to true will the mock pages be accessible
19 20 21 22 23 24 25 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 19 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
27 28 29 |
# File 'lib/defra_ruby_mocks/configuration.rb', line 27 def enabled? @enable end |