Method: Configer::Object#method_missing

Defined in:
lib/configer/object.rb

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



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/configer/object.rb', line 11

def method_missing( method_name, *args, &block )

  obj_methods = self.__send__(:methods)
  if method_name[-1] == '=' && !obj_methods.include?(method_name)
    self[method_name[0..-2]]= *args
    return self[method_name[0..-2]]

  elsif self[method_name.to_s].nil? && obj_methods.include?(method_name)

    if block_given?
      return self.__send__(method_name,*args,&block)
    else
      return self.__send__(method_name,*args)
    end

  else
    return self[method_name.to_s]

  end

end