Module: EasyRedis::Setters

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

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



9
10
11
# File 'lib/easy_redis/methods/setters.rb', line 9

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

Instance Method Details

#r_set(attribute, value) ⇒ Object Also known as: redis_set



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

def r_set(attribute, value)
  self.redis_cli.hset(redis_key, attribute, YAML.dump(value))
end