Class: DefraRubyMocks::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/defra_ruby_mocks/configuration.rb

Constant Summary collapse

DEFAULT_DELAY =
1000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
# File 'lib/defra_ruby_mocks/configuration.rb', line 11

def initialize
  @enable = false
  @delay = DEFAULT_DELAY
end

Instance Attribute Details

#delayObject

Returns the value of attribute delay.



9
10
11
# File 'lib/defra_ruby_mocks/configuration.rb', line 9

def delay
  @delay
end

#govpay_domainObject

Returns the value of attribute govpay_domain.



8
9
10
# File 'lib/defra_ruby_mocks/configuration.rb', line 8

def govpay_domain
  @govpay_domain
end

Instance Method Details

#enable=(arg) ⇒ Object

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



18
19
20
21
22
23
24
# File 'lib/defra_ruby_mocks/configuration.rb', line 18

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

Returns:

  • (Boolean)


26
27
28
# File 'lib/defra_ruby_mocks/configuration.rb', line 26

def enabled?
  @enable
end