Class: Redis::Model::FieldProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/redis/model.rb

Overview

:nodoc

Direct Known Subclasses

ListProxy, SetProxy

Instance Method Summary collapse

Constructor Details

#initialize(redis, name, marshal) ⇒ FieldProxy

Returns a new instance of FieldProxy.



232
233
234
235
236
# File 'lib/redis/model.rb', line 232

def initialize(redis, name, marshal)
  @redis   = redis
  @name    = name
  @marshal = marshal
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *argv) ⇒ Object

Raises:

  • (NoMethodError)


238
239
240
241
242
# File 'lib/redis/model.rb', line 238

def method_missing(method, *argv)
  translated_method = translate_method_name(method)
  raise NoMethodError.new("Method '#{method}' is not defined") unless translated_method
  @redis.send translated_method, @name, *argv
end