Class: Spree::Orders::Sort

Inherits:
Object
  • Object
show all
Defined in:
app/sorters/spree/orders/sort.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, params) ⇒ Sort

Returns a new instance of Sort.



6
7
8
9
# File 'app/sorters/spree/orders/sort.rb', line 6

def initialize(scope, params)
  @scope = scope
  @sort = params[:sort]
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



4
5
6
# File 'app/sorters/spree/orders/sort.rb', line 4

def scope
  @scope
end

#sortObject (readonly)

Returns the value of attribute sort.



4
5
6
# File 'app/sorters/spree/orders/sort.rb', line 4

def sort
  @sort
end

Instance Method Details

#callObject



11
12
13
14
15
# File 'app/sorters/spree/orders/sort.rb', line 11

def call
  orders = completed_at(scope)

  orders
end