Class: Herder::Model::Query
- Inherits:
-
Object
- Object
- Herder::Model::Query
- Defined in:
- lib/herder/model/query.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
Returns the value of attribute model.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(model) ⇒ Query
constructor
A new instance of Query.
- #to_s ⇒ Object
- #where(*prms) ⇒ Object
Constructor Details
#initialize(model) ⇒ Query
Returns a new instance of Query.
6 7 8 9 |
# File 'lib/herder/model/query.rb', line 6 def initialize model self.model = model self.params = {} end |
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
4 5 6 |
# File 'lib/herder/model/query.rb', line 4 def model @model end |
#params ⇒ Object
Returns the value of attribute params.
4 5 6 |
# File 'lib/herder/model/query.rb', line 4 def params @params end |
Instance Method Details
#each(&block) ⇒ Object
16 17 18 |
# File 'lib/herder/model/query.rb', line 16 def each &block query.each &block end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/herder/model/query.rb', line 20 def to_s query.to_s end |
#where(*prms) ⇒ Object
11 12 13 14 |
# File 'lib/herder/model/query.rb', line 11 def where *prms params.merge!(sanitize prms) self end |