Class: SparkApi::Pagination
- Inherits:
-
Object
- Object
- SparkApi::Pagination
- Defined in:
- lib/spark_api/paginate.rb
Overview
Pagination
Simple class representing the API's pagination response object
Instance Attribute Summary collapse
-
#current_page ⇒ Object
Returns the value of attribute current_page.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
-
#total_pages ⇒ Object
Returns the value of attribute total_pages.
-
#total_rows ⇒ Object
Returns the value of attribute total_rows.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Pagination
constructor
A new instance of Pagination.
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_page ⇒ Object
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_size ⇒ Object
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_pages ⇒ Object
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_rows ⇒ Object
Returns the value of attribute total_rows.
100 101 102 |
# File 'lib/spark_api/paginate.rb', line 100 def total_rows @total_rows end |