Class: DotHash::Settings

Inherits:
Properties show all
Defined in:
lib/dot_hash/settings.rb

Instance Attribute Summary

Attributes inherited from Properties

#hash

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Properties

#==, #[], #fetch, #has_key?, #method_missing, #respond_to_missing?, #to_json, #to_s

Constructor Details

#initialize(*args) ⇒ Settings

Returns a new instance of Settings.



3
4
5
# File 'lib/dot_hash/settings.rb', line 3

def initialize(*args)
  super Loader.new(*args).hash
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DotHash::Properties

Class Method Details

.load(*args) ⇒ Object



20
21
22
# File 'lib/dot_hash/settings.rb', line 20

def load(*args)
  instance.load(*args)
end

.method_missing(*args, &block) ⇒ Object



12
13
14
# File 'lib/dot_hash/settings.rb', line 12

def method_missing(*args, &block)
  instance.public_send(*args, &block)
end

.respond_to_missing?(*args) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/dot_hash/settings.rb', line 16

def respond_to_missing?(*args)
  instance.respond_to?(*args)
end

Instance Method Details

#load(*args) ⇒ Object



7
8
9
# File 'lib/dot_hash/settings.rb', line 7

def load(*args)
  hash.replace Loader.new(hash, *args).hash
end