Class: Dry::Credentials::YAML
- Inherits:
-
Object
- Object
- Dry::Credentials::YAML
- Defined in:
- lib/dry/credentials/yaml.rb
Defined Under Namespace
Classes: Query
Instance Method Summary collapse
-
#initialize(yaml) ⇒ YAML
constructor
A new instance of YAML.
-
#inject_into(object) ⇒ Array
Define readers for the first level of the credentials on the given
object
.
Constructor Details
#initialize(yaml) ⇒ YAML
Returns a new instance of YAML.
8 9 10 11 12 13 14 |
# File 'lib/dry/credentials/yaml.rb', line 8 def initialize(yaml) @yaml = yaml @hash = ::YAML.safe_load yaml fail Dry::Credentials::YAMLFormatError unless @hash.instance_of? Hash rescue Psych::DisallowedClass raise Dry::Credentials::YAMLFormatError end |