Module: Lab42::NHash::ClassMethods

Included in:
Lab42::NHash
Defined in:
lib/lab42/nhash/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#from_sources(*sources) ⇒ Object



9
10
11
# File 'lib/lab42/nhash/class_methods.rb', line 9

def from_sources *sources
  __from_sources__(sources)
end

#from_sources_with_indifferent_access(*sources) ⇒ Object



13
14
15
# File 'lib/lab42/nhash/class_methods.rb', line 13

def from_sources_with_indifferent_access *sources
  __from_sources__(sources, indifferent_access: true )
end

#from_value(value, options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/lab42/nhash/class_methods.rb', line 17

def from_value value, options={}
  case value
  when Hash
    new( value ).import_options options
  when Enumerable
    Lab42::NHash::Enum.new value, options
  else
    value
  end
end