Class: Config::Sources::HashSource
- Inherits:
-
Object
- Object
- Config::Sources::HashSource
- Defined in:
- lib/config/sources/hash_source.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(hash) ⇒ HashSource
constructor
A new instance of HashSource.
-
#load ⇒ Object
returns hash that was passed in to initialize.
Constructor Details
#initialize(hash) ⇒ HashSource
Returns a new instance of HashSource.
6 7 8 |
# File 'lib/config/sources/hash_source.rb', line 6 def initialize(hash) @hash = hash end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
4 5 6 |
# File 'lib/config/sources/hash_source.rb', line 4 def hash @hash end |
Instance Method Details
#load ⇒ Object
returns hash that was passed in to initialize
11 12 13 |
# File 'lib/config/sources/hash_source.rb', line 11 def load hash.is_a?(Hash) ? hash : {} end |