Class: EML::Config

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/eml/config.rb

Direct Known Subclasses

UK::Config

Instance Method Summary collapse

Instance Method Details

#environmentObject



9
10
11
# File 'lib/eml/config.rb', line 9

def environment
  EML::Environment
end

#environment=(value) ⇒ Object



14
15
16
# File 'lib/eml/config.rb', line 14

def environment=(value)
  EML::Environment.set(value)
end

#require(param) ⇒ Object



19
20
21
22
23
24
# File 'lib/eml/config.rb', line 19

def require(param)
  value = public_send(param)
  return value unless value.nil? || value.empty?

  require_error(param)
end

#require_parameter(param) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/eml/config.rb', line 27

def require_parameter(param)
  require(param)
rescue ArgumentError => e
  message = e.message + "\n" \
    "Alternatively, you can pass dynamic values with your request " \
    "parameters"
  raise ArgumentError, message
end