class DefraRubyMocks::Configuration

Constants

DEFAULT_DELAY

Attributes

delay[R]
worldpay_admin_code[RW]
worldpay_domain[RW]
worldpay_mac_secret[RW]
worldpay_merchant_code[RW]

Public Class Methods

new() click to toggle source
# File lib/defra_ruby_mocks/configuration.rb, line 12
def initialize
  @enable = false
  @delay = DEFAULT_DELAY
end

Public Instance Methods

delay=(arg) click to toggle source

Set a delay in milliseconds for the mocks to respond. Defaults to 1000 (1 sec)

# File lib/defra_ruby_mocks/configuration.rb, line 33
def delay=(arg)
  # We implement our own setter to handle values being passed in as strings
  # rather than integers
  @delay = arg.to_i

  @delay = DEFAULT_DELAY if @delay.zero?
end
enable=(arg) click to toggle source

Controls whether the mocks are enabled. Only if set to true will the mock pages be accessible

# 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?() click to toggle source
# File lib/defra_ruby_mocks/configuration.rb, line 27
def enabled?
  @enable
end