Class: NoSE::Backend::Backend::LimitStatementStep

Inherits:
StatementStep show all
Defined in:
lib/nose/backend.rb

Overview

Perform a client-side limit of the result set size

Instance Attribute Summary

Attributes inherited from StatementStep

#index

Instance Method Summary collapse

Methods included from Supertype

included

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

Returns:



288
289
290
# File 'lib/nose/backend.rb', line 288

def process(_conditions, results)
  results[0..@limit - 1]
end