class Trubl::Pagination

Attributes

current_page[RW]
order[RW]
page[RW]
per_page[RW]
total_entries[RW]

Public Instance Methods

from_response(response) click to toggle source
# File lib/trubl/pagination.rb, line 5
def from_response(response)
  pagination = pagination_from_response(response)
  %(order current_page per_page page total_entries).each do |attr|
    self.send("#{attr}=", pagination[attr])
  end
  self
end
pagination_from_response(response) click to toggle source
# File lib/trubl/pagination.rb, line 13
def pagination_from_response(response)
  JSON.parse(response.body)["pagination"]
end