Class: Ettin::Sources::HashSource
- Inherits:
-
Ettin::Source
- Object
- Ettin::Source
- Ettin::Sources::HashSource
- Defined in:
- lib/ettin/sources/hash_source.rb
Overview
Config data from a ruby hash
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ HashSource
constructor
A new instance of HashSource.
- #load ⇒ Object
Methods inherited from Ettin::Source
for, register, register_default, registry
Constructor Details
#initialize(hash) ⇒ HashSource
Returns a new instance of HashSource.
16 17 18 |
# File 'lib/ettin/sources/hash_source.rb', line 16 def initialize(hash) @hash = hash.is_a?(Hash) ? hash : {} end |
Class Method Details
.handles?(target) ⇒ Boolean
12 13 14 |
# File 'lib/ettin/sources/hash_source.rb', line 12 def self.handles?(target) target.is_a? Hash end |
Instance Method Details
#load ⇒ Object
20 21 22 |
# File 'lib/ettin/sources/hash_source.rb', line 20 def load hash end |