Class: SecretsManager::Config::SecretConfig
- Inherits:
-
Object
- Object
- SecretsManager::Config::SecretConfig
- Defined in:
- lib/secrets_manager/config.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, id, input, type, path) ⇒ SecretConfig
constructor
A new instance of SecretConfig.
- #json? ⇒ Boolean
- #json_output? ⇒ Boolean
- #plaintext? ⇒ Boolean
- #to_env? ⇒ Boolean
- #to_file? ⇒ Boolean
- #yaml_output? ⇒ Boolean
Constructor Details
#initialize(name, id, input, type, path) ⇒ SecretConfig
Returns a new instance of SecretConfig.
31 32 33 34 35 36 37 |
# File 'lib/secrets_manager/config.rb', line 31 def initialize(name, id, input, type, path) @name = name @id = id @input = input || 'json' @type = type || 'env' @path = path || 'config/application.yml' end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
29 30 31 |
# File 'lib/secrets_manager/config.rb', line 29 def id @id end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
29 30 31 |
# File 'lib/secrets_manager/config.rb', line 29 def input @input end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/secrets_manager/config.rb', line 29 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
29 30 31 |
# File 'lib/secrets_manager/config.rb', line 29 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
29 30 31 |
# File 'lib/secrets_manager/config.rb', line 29 def type @type end |
Instance Method Details
#json? ⇒ Boolean
43 44 45 |
# File 'lib/secrets_manager/config.rb', line 43 def json? input == 'json' end |
#json_output? ⇒ Boolean
59 60 61 |
# File 'lib/secrets_manager/config.rb', line 59 def json_output? path.strip.end_with? '.json' end |
#plaintext? ⇒ Boolean
39 40 41 |
# File 'lib/secrets_manager/config.rb', line 39 def plaintext? input == 'plaintext' end |
#to_env? ⇒ Boolean
47 48 49 |
# File 'lib/secrets_manager/config.rb', line 47 def to_env? type == 'env' end |
#to_file? ⇒ Boolean
51 52 53 |
# File 'lib/secrets_manager/config.rb', line 51 def to_file? type == 'file' end |
#yaml_output? ⇒ Boolean
55 56 57 |
# File 'lib/secrets_manager/config.rb', line 55 def yaml_output? path.strip.end_with? '.yml' end |