Class: NoSE::Backend::Backend::LimitStatementStep
- Inherits:
-
StatementStep
- Object
- StatementStep
- NoSE::Backend::Backend::LimitStatementStep
- Defined in:
- lib/nose/backend.rb
Overview
Perform a client-side limit of the result set size
Instance Attribute Summary
Attributes inherited from StatementStep
Instance Method Summary collapse
-
#initialize(_client, _fields, _conditions, step, _next_step, _prev_step) ⇒ LimitStatementStep
constructor
A new instance of LimitStatementStep.
-
#process(_conditions, results) ⇒ Array<Hash>
Remove results past the limit.
Methods included from Supertype
Constructor Details
#initialize(_client, _fields, _conditions, step, _next_step, _prev_step) ⇒ LimitStatementStep
Returns a new instance of LimitStatementStep.
281 282 283 284 |
# File 'lib/nose/backend.rb', line 281 def initialize(_client, _fields, _conditions, step, _next_step, _prev_step) @limit = step.limit end |
Instance Method Details
#process(_conditions, results) ⇒ Array<Hash>
Remove results past the limit
288 289 290 |
# File 'lib/nose/backend.rb', line 288 def process(_conditions, results) results[0..@limit - 1] end |