Class: Greedo::ArrayPaginator

Inherits:
Object
  • Object
show all
Defined in:
lib/greedo/paginator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(records, order, order_by) ⇒ ArrayPaginator

Returns a new instance of ArrayPaginator.



39
40
41
42
43
# File 'lib/greedo/paginator.rb', line 39

def initialize(records, order, order_by)
  @records = records
  @order = order
  @order_by = order_by
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



37
38
39
# File 'lib/greedo/paginator.rb', line 37

def order
  @order
end

#order_byObject (readonly)

Returns the value of attribute order_by.



37
38
39
# File 'lib/greedo/paginator.rb', line 37

def order_by
  @order_by
end

Instance Method Details

#recordsObject



45
46
47
# File 'lib/greedo/paginator.rb', line 45

def records
  @sorted_records ||= sort_records
end

#show?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/greedo/paginator.rb', line 49

def show?
  false
end