Class: DataMapper::LoadedSet

Inherits:
Object
  • Object
show all
Defined in:
lib/data_mapper/loaded_set.rb

Overview

LoadedSet’s purpose is to give a common reference for the results of a query, so that they can be manipulated by the DataMapper, behind-the-scenes, as a set.

Defined Under Namespace

Classes: ObjectIdCollection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ LoadedSet

Returns a new instance of LoadedSet.



14
15
16
17
# File 'lib/data_mapper/loaded_set.rb', line 14

def initialize(database)
  @database = database
  @instances = [] # ObjectIdCollection.new
end

Instance Attribute Details

#databaseObject (readonly)

Provides a reference to the database that originally loaded the instances.



10
11
12
# File 'lib/data_mapper/loaded_set.rb', line 10

def database
  @database
end

#instancesObject (readonly)

Provides an Enumerable of the instances loaded in the set.



12
13
14
# File 'lib/data_mapper/loaded_set.rb', line 12

def instances
  @instances
end