Method: Confg::Configuration#method_missing

Defined in:
lib/confg/configuration.rb

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



98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/confg/configuration.rb', line 98

def method_missing(method_name, *args, &block)
  key = method_name.to_s

  if __getobj__.respond_to?(key)
    super
  elsif key.end_with?("=") && !args.empty?
    set(key[0...-1], args[0])
  elsif block_given?
    open_block(key, &block)
  else
    fetch(key)
  end
end