Class: Ohm::Model

Inherits:
Object show all
Defined in:
lib/ohm-zset.rb

Class Method Summary collapse

Class Method Details

.zset(name, model, *score_field) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ohm-zset.rb', line 15

def self.zset(name, model, *score_field)

  define_method name do
    model = Utils.const(self.class, model)
    Ohm::ZSet.new(key[name], model.key, model, score_field)
  end

  meta_def name do
    model = Utils.const(self, model)
    Ohm::ZSet.new(key[name], model.key, model, score_field)
  end

end