Class: XIVAPI::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/xivapi/page.rb

Overview

A single page of results from XIVAPI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Page

Creates an object for storing a Page of results from XIVAPI

Parameters:

  • response

    The response of an HTTP request



12
13
14
15
16
# File 'lib/xivapi/page.rb', line 12

def initialize(response)
  @results = response.results
  pagination = response.pagination
  @next_page = pagination.page_next unless pagination.page == pagination.page_total
end

Instance Attribute Details

#next_pageInteger (readonly)

Returns the page number of the next results

Returns:

  • (Integer)

    the page number of the next results



8
9
10
# File 'lib/xivapi/page.rb', line 8

def next_page
  @next_page
end

#resultsObject (readonly)

Returns the results

Returns:

  • the results



5
6
7
# File 'lib/xivapi/page.rb', line 5

def results
  @results
end