lib/sdb/active_sdb.rb
# support accessing attribute values via method call
support accessing attribute values via method call
support accessing attribute values via method call
def method_missing(method_sym, *args)
        method_name = method_sym.to_s
        setter = method_name[-1,1] == '='
        method_name.chop! if setter
        if @attributes.has_key?(method_name) || self.class.column?(method_name)
          setter ? self[method_name] = args.first : self[method_name]
        else
          super
        end
      end
def method_missing ( method_sym , * args ) method_name = method_sym . to_s setter = method_name [ - 1 , 1 ] == '=' method_name . chop! if setter if @attributes . has_key? ( method_name ) || self . class . column? ( method_name ) setter ? self [ method_name ] = args . first : self [ method_name ] else super end end
support accessing attribute values via method call
support accessing attribute values via method call
method_sym
<not_specific>
args
<not_specific>