Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- lib/prefix_api_key/configuration.rb
Instance Attribute Summary collapse
-
#password_long ⇒ Object
Returns the value of attribute password_long.
-
#password_short ⇒ Object
Returns the value of attribute password_short.
-
#salt_long ⇒ Object
Returns the value of attribute salt_long.
-
#salt_short ⇒ Object
Returns the value of attribute salt_short.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 |
# File 'lib/prefix_api_key/configuration.rb', line 6 def initialize @salt_short = ENV.fetch('SALT_SHORT', nil) @salt_long = ENV.fetch('SALT_LONG', nil) @password_short = ENV.fetch('PASSWORD_SHORT', nil) @password_long = ENV.fetch('PASSWORD_LONG', nil) end |
Instance Attribute Details
#password_long ⇒ Object
Returns the value of attribute password_long.
4 5 6 |
# File 'lib/prefix_api_key/configuration.rb', line 4 def password_long @password_long end |
#password_short ⇒ Object
Returns the value of attribute password_short.
4 5 6 |
# File 'lib/prefix_api_key/configuration.rb', line 4 def password_short @password_short end |
#salt_long ⇒ Object
Returns the value of attribute salt_long.
4 5 6 |
# File 'lib/prefix_api_key/configuration.rb', line 4 def salt_long @salt_long end |
#salt_short ⇒ Object
Returns the value of attribute salt_short.
4 5 6 |
# File 'lib/prefix_api_key/configuration.rb', line 4 def salt_short @salt_short end |
Instance Method Details
#valid? ⇒ Boolean
13 14 15 16 17 |
# File 'lib/prefix_api_key/configuration.rb', line 13 def valid? raise StandardError, 'Missing configuration environment' if @salt_short.nil? || @salt_long.nil? || @password_short.nil? || @password_long.nil? true end |