Class: ConfigDSL::Memory::MemoryLayer

Inherits:
Hash
  • Object
show all
Defined in:
lib/configdsl.rb

Constant Summary collapse

ALIASED_METHODS =
[
  :[], :fetch
]

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object

Allow methods invocation to read values



35
36
37
38
# File 'lib/configdsl.rb', line 35

def method_missing(meth, *args, &block)
  return self[meth] if has_key?(meth)
  super
end

Class Method Details

.make_alias_method(meth) ⇒ Object



8
9
10
# File 'lib/configdsl.rb', line 8

def self.make_alias_method(meth)
  "original_#{meth}".to_sym
end

Instance Method Details

#respond_to?(meth) ⇒ Boolean

Allow methods invocation to read values, second part

Returns:

  • (Boolean)


41
42
43
44
# File 'lib/configdsl.rb', line 41

def respond_to?(meth)
  return true if has_key?(meth)
  super
end