lib/configliere/define.rb
def method_missing meth, *args
      meth.to_s =~ /^(\w+)(=)?$/ or return super
      name, setter = [$1.to_sym, $2]
      return(super) unless has_definition?(name)
      if setter && (args.size == 1)
        self[name] = args.first
      elsif (!setter) && args.empty?
        self[name]
      else super ; end
    end
# Pretend that any #define'd parameter is a method
#
# @example
#   Settings.define :foo
#   Settings.foo = 4
#   Settings.foo      #=> 4
Pretend that any #define'd parameter is a method
Pretend that any #define ' d parameter is a method
def method_missing meth, *args
      meth.to_s =~ /^(\w+)(=)?$/ or return super
      name, setter = [$1.to_sym, $2]
      return(super) unless has_definition?(name)
      if setter && (args.size == 1)
        self[name] = args.first
      elsif (!setter) && args.empty?
        self[name]
      else super ; end
    end
def method_missing meth , * args meth . to_s =~ / ^( \w +)(=)?$ / or return super name , setter = [ $1 . to_sym , $2 ] return ( super ) unless has_definition? ( name ) if setter && ( args . size == 1 ) self [ name ] = args . first elsif ( ! setter ) && args . empty? self [ name ] else super ; end end
Pretend that any #define'd parameter is a method
Pretend that any #define ' d parameter is a method
meth
args
example
None