Class: ApiOnlyPagination::PaginatedData
- Inherits:
-
Object
- Object
- ApiOnlyPagination::PaginatedData
- Defined in:
- lib/api_only_pagination/paginated_data.rb
Overview
Response object class
Instance Attribute Summary collapse
-
#current_page ⇒ Object
Returns the value of attribute current_page.
-
#data ⇒ Object
Returns the value of attribute data.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#total_pages ⇒ Object
Returns the value of attribute total_pages.
-
#total_records ⇒ Object
Returns the value of attribute total_records.
Instance Method Summary collapse
-
#initialize(data:, per_page:, current_page:, total_pages:, total_records:) ⇒ PaginatedData
constructor
A new instance of PaginatedData.
Constructor Details
#initialize(data:, per_page:, current_page:, total_pages:, total_records:) ⇒ PaginatedData
Returns a new instance of PaginatedData.
13 14 15 16 17 18 19 |
# File 'lib/api_only_pagination/paginated_data.rb', line 13 def initialize(data:, per_page:, current_page:, total_pages:, total_records:) @data = data @per_page = per_page @current_page = current_page @total_pages = total_pages @total_records = total_records end |
Instance Attribute Details
#current_page ⇒ Object
Returns the value of attribute current_page.
7 8 9 |
# File 'lib/api_only_pagination/paginated_data.rb', line 7 def current_page @current_page end |
#data ⇒ Object
Returns the value of attribute data.
7 8 9 |
# File 'lib/api_only_pagination/paginated_data.rb', line 7 def data @data end |
#per_page ⇒ Object
Returns the value of attribute per_page.
7 8 9 |
# File 'lib/api_only_pagination/paginated_data.rb', line 7 def per_page @per_page end |
#total_pages ⇒ Object
Returns the value of attribute total_pages.
7 8 9 |
# File 'lib/api_only_pagination/paginated_data.rb', line 7 def total_pages @total_pages end |
#total_records ⇒ Object
Returns the value of attribute total_records.
7 8 9 |
# File 'lib/api_only_pagination/paginated_data.rb', line 7 def total_records @total_records end |