class Dhis2::Pager

Attributes

next_page[R]
page[R]
page_count[R]
page_size[R]
total[R]

Public Class Methods

new(hash) click to toggle source
# File lib/dhis2/pager.rb, line 7
def initialize(hash)
  @page       = hash["page"]
  @page_count = hash["page_count"] || hash["pageCount"]
  @total      = hash["total"]
  @next_page  = hash["next_page"] || hash["nextPage"]
  @page_size  = hash["page_size"] || hash["pageSize"]
end

Public Instance Methods

last_page?() click to toggle source
# File lib/dhis2/pager.rb, line 15
def last_page?
  page * page_size >= total
end