Class: ApiOnlyPagination::PaginatedData

Inherits:
Object
  • Object
show all
Defined in:
lib/api_only_pagination/paginated_data.rb

Overview

Response object class

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pageObject

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

#dataObject

Returns the value of attribute data.



7
8
9
# File 'lib/api_only_pagination/paginated_data.rb', line 7

def data
  @data
end

#per_pageObject

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_pagesObject

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_recordsObject

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