Class: QueryableAssociationProxy
- Inherits:
-
Object
- Object
- QueryableAssociationProxy
- Extended by:
- Forwardable
- Defined in:
- lib/sequel_mapper/queryable_association_proxy.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(database_enum, loader) ⇒ QueryableAssociationProxy
constructor
A new instance of QueryableAssociationProxy.
- #where(criteria) ⇒ Object
Constructor Details
#initialize(database_enum, loader) ⇒ QueryableAssociationProxy
Returns a new instance of QueryableAssociationProxy.
2 3 4 5 |
# File 'lib/sequel_mapper/queryable_association_proxy.rb', line 2 def initialize(database_enum, loader) @database_enum = database_enum @loader = loader end |
Instance Method Details
#each(&block) ⇒ Object
18 19 20 21 22 |
# File 'lib/sequel_mapper/queryable_association_proxy.rb', line 18 def each(&block) database_enum .map(&loader) .each(&block) end |
#where(criteria) ⇒ Object
13 14 15 16 |
# File 'lib/sequel_mapper/queryable_association_proxy.rb', line 13 def where(criteria) @database_enum = database_enum.where(criteria) self end |