Sha256: 87718fa88e66205e7e194bb4433ce5d2308627e2e8ee07b8e325a42273865baf
Contents?: true
Size: 632 Bytes
Versions: 6
Compression:
Stored size: 632 Bytes
Contents
module CDQ class CDQCollectionProxy < CDQTargetedQuery def initialize(objects, entity_description) @objects = objects super(entity_description, constantize(entity_description.managedObjectClassName)) @predicate = self.where("%@ CONTAINS SELF", @objects).predicate end def count @objects.size end alias :length :count alias :size :count def get @objects end def array @objects end def first(n = 1) n == 1 ? @objects.first : @objects.first(n) end def last(n = 1) n == 1 ? @objects.last : @objects.last(n) end end end
Version data entries
6 entries across 6 versions & 1 rubygems