Class: SparkApi::Pagination

Inherits:
Object
  • Object
show all
Defined in:
lib/spark_api/paginate.rb

Overview

Pagination

Simple class representing the API's pagination response object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Pagination

Returns a new instance of Pagination.



101
102
103
104
105
106
# File 'lib/spark_api/paginate.rb', line 101

def initialize(hash)
  @total_rows     = hash["TotalRows"]
  @page_size      = hash["PageSize"]
  @total_pages    = hash["TotalPages"]
  @current_page   = hash["CurrentPage"]
end

Instance Attribute Details

#current_pageObject

Returns the value of attribute current_page.



100
101
102
# File 'lib/spark_api/paginate.rb', line 100

def current_page
  @current_page
end

#page_sizeObject

Returns the value of attribute page_size.



100
101
102
# File 'lib/spark_api/paginate.rb', line 100

def page_size
  @page_size
end

#total_pagesObject

Returns the value of attribute total_pages.



100
101
102
# File 'lib/spark_api/paginate.rb', line 100

def total_pages
  @total_pages
end

#total_rowsObject

Returns the value of attribute total_rows.



100
101
102
# File 'lib/spark_api/paginate.rb', line 100

def total_rows
  @total_rows
end