Class: ShopsavvyDataApi::PaginationInfo
- Inherits:
-
Object
- Object
- ShopsavvyDataApi::PaginationInfo
- Defined in:
- lib/shopsavvy_data_api/models.rb
Overview
Pagination info for search results
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#returned ⇒ Object
readonly
Returns the value of attribute returned.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(data) ⇒ PaginationInfo
constructor
A new instance of PaginationInfo.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ PaginationInfo
Returns a new instance of PaginationInfo.
370 371 372 373 374 375 |
# File 'lib/shopsavvy_data_api/models.rb', line 370 def initialize(data) @total = data["total"].to_i @limit = data["limit"].to_i @offset = data["offset"].to_i @returned = data["returned"].to_i end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
368 369 370 |
# File 'lib/shopsavvy_data_api/models.rb', line 368 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
368 369 370 |
# File 'lib/shopsavvy_data_api/models.rb', line 368 def offset @offset end |
#returned ⇒ Object (readonly)
Returns the value of attribute returned.
368 369 370 |
# File 'lib/shopsavvy_data_api/models.rb', line 368 def returned @returned end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
368 369 370 |
# File 'lib/shopsavvy_data_api/models.rb', line 368 def total @total end |
Instance Method Details
#to_h ⇒ Object
377 378 379 380 381 382 383 384 |
# File 'lib/shopsavvy_data_api/models.rb', line 377 def to_h { total: total, limit: limit, offset: offset, returned: returned } end |