Class: Confset::Sources::HashSource

Inherits:
Object
  • Object
show all
Defined in:
lib/confset/sources/hash_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ HashSource

Returns a new instance of HashSource.



8
9
10
# File 'lib/confset/sources/hash_source.rb', line 8

def initialize(hash)
  @hash = hash
end

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



6
7
8
# File 'lib/confset/sources/hash_source.rb', line 6

def hash
  @hash
end

Instance Method Details

#loadObject

returns hash that was passed in to initialize



13
14
15
# File 'lib/confset/sources/hash_source.rb', line 13

def load
  hash.is_a?(Hash) ? hash : {}
end