Module: Qtunes::Paginatable
- Defined in:
- lib/qtunes/paginatable.rb
Instance Attribute Summary collapse
-
#per_page ⇒ Object
Returns the value of attribute per_page.
Instance Method Summary collapse
Instance Attribute Details
#per_page ⇒ Object
Returns the value of attribute per_page.
3 4 5 |
# File 'lib/qtunes/paginatable.rb', line 3 def per_page @per_page end |
Instance Method Details
#page(n) ⇒ Object
5 6 7 |
# File 'lib/qtunes/paginatable.rb', line 5 def page(n) slice(*[n - 1, 1].map{|i| i * self.per_page }) || [] end |