Class: DefraRubyEmail::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



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

def initialize
  @enable = false
end

Instance Attribute Details

#notify_api_keyObject

Returns the value of attribute notify_api_key.



6
7
8
# File 'lib/defra_ruby_email/configuration.rb', line 6

def notify_api_key
  @notify_api_key
end

Instance Method Details

#enable=(arg) ⇒ Object

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



14
15
16
17
18
19
20
# File 'lib/defra_ruby_email/configuration.rb', line 14

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)


22
23
24
# File 'lib/defra_ruby_email/configuration.rb', line 22

def enabled?
  @enable
end