Module: Qtunes::Paginatable

Defined in:
lib/qtunes/paginatable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#per_pageObject

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