class NoSE::Backend::Backend::SortStatementStep

Perform sorting external to the backend

Public Class Methods

new(_client, _fields, _conditions, step, _next_step, _prev_step) click to toggle source
# File lib/nose/backend.rb, line 263
def initialize(_client, _fields, _conditions,
               step, _next_step, _prev_step)
  @step = step
end

Public Instance Methods

process(_conditions, results) click to toggle source

Sort results by a list of fields given in the step @return [Array<Hash>]

# File lib/nose/backend.rb, line 270
def process(_conditions, results)
  results.sort_by! do |row|
    @step.sort_fields.map do |field|
      row[field.id]
    end
  end
end