Class: Greedo::ArrayPaginator
- Inherits:
-
Object
- Object
- Greedo::ArrayPaginator
- Defined in:
- lib/greedo/paginator.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#order_by ⇒ Object
readonly
Returns the value of attribute order_by.
Instance Method Summary collapse
-
#initialize(records, order, order_by) ⇒ ArrayPaginator
constructor
A new instance of ArrayPaginator.
- #records ⇒ Object
- #show? ⇒ Boolean
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
#order ⇒ Object (readonly)
Returns the value of attribute order.
37 38 39 |
# File 'lib/greedo/paginator.rb', line 37 def order @order end |
#order_by ⇒ Object (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
#records ⇒ Object
45 46 47 |
# File 'lib/greedo/paginator.rb', line 45 def records @sorted_records ||= sort_records end |
#show? ⇒ Boolean
49 50 51 |
# File 'lib/greedo/paginator.rb', line 49 def show? false end |