Exception: Userlist::ConfigurationError

Inherits:
Error
  • Object
show all
Defined in:
lib/userlist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ ConfigurationError

Returns a new instance of ConfigurationError.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/userlist.rb', line 17

def initialize(key)
  @key = key.to_sym

  super <<~MESSAGE
    Missing required configuration value for `#{key}`

    Please set a value for `#{key}` using an environment variable:

      USERLIST_#{key.to_s.upcase}=some-value-here

    or via the `Userlist.configure` method:

      Userlist.configure do |config|
        config.#{key} = 'some-value-here'
      end
  MESSAGE
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



15
16
17
# File 'lib/userlist.rb', line 15

def key
  @key
end