Module: EasyRedis::Updaters

Defined in:
lib/easy_redis/methods/updaters.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



10
11
12
# File 'lib/easy_redis/methods/updaters.rb', line 10

def method_missing(meth, *args, &block)
  (meth.to_s =~ /^redis_update_(.+)$/ || meth.to_s =~ /^r_update_(.+)$/) ? r_delete($1, *args) : super
end

Instance Method Details

#r_update(attribute, value) ⇒ Object Also known as: redis_update



5
6
7
8
# File 'lib/easy_redis/methods/updaters.rb', line 5

def r_update(attribute, value)
  self.r_del(attribute)
  self.r_set(attribute, value)
end