Class: Authorize::Redis::ModelSet

Inherits:
Set
  • Object
show all
Defined in:
lib/authorize/redis/model_set.rb

Overview

A persistent set of homomorphic Redis-like models

Constant Summary

Constants inherited from Base

Base::NAMESPACE_SEPARATOR

Instance Attribute Summary

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Set

#<<, #add, #delete, #first, #include?, #sample, #valid?

Methods inherited from Base

#==, #_dump, _load, connection, connection_base?, connection_manager, #db, #destroy, #eql?, exists?, #exists?, generate_key, #hash, index, load, load_all, #logger, #method_missing, new, next_counter, #reload, #respond_to?, subordinate_key, #subordinate_key, #to_yaml, #valid?

Constructor Details

#initialize(klass) ⇒ ModelSet

Returns a new instance of ModelSet.



5
6
7
8
# File 'lib/authorize/redis/model_set.rb', line 5

def initialize(klass)
  super()
  @klass = klass
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Authorize::Redis::Base

Instance Method Details

#__getobj__Object



14
15
16
# File 'lib/authorize/redis/model_set.rb', line 14

def __getobj__
  super.map{|eid| @klass.load(eid)}.to_set.freeze
end