Class: IseshimaStore::Relation
- Inherits:
-
Object
- Object
- IseshimaStore::Relation
- Extended by:
- Forwardable
- Includes:
- Enumerable, QueryMethods
- Defined in:
- lib/iseshima_store/relation.rb
Instance Attribute Summary collapse
-
#where_clause ⇒ Object
Returns the value of attribute where_clause.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(klass) ⇒ Relation
constructor
A new instance of Relation.
- #spawn ⇒ Object
Methods included from QueryMethods
#all, #exists?, #find, #find_by, #inspect, #parent, #to_a, #where, #where!
Constructor Details
#initialize(klass) ⇒ Relation
Returns a new instance of Relation.
13 14 15 16 |
# File 'lib/iseshima_store/relation.rb', line 13 def initialize(klass) @klass = klass @where_clause = IseshimaStore::WhereClause.new(@klass) end |
Instance Attribute Details
#where_clause ⇒ Object
Returns the value of attribute where_clause.
10 11 12 |
# File 'lib/iseshima_store/relation.rb', line 10 def where_clause @where_clause end |
Instance Method Details
#each ⇒ Object
22 23 24 |
# File 'lib/iseshima_store/relation.rb', line 22 def each to_a.each { |obj| yield obj } end |
#spawn ⇒ Object
18 19 20 |
# File 'lib/iseshima_store/relation.rb', line 18 def spawn clone end |