Class: ShopsavvyDataApi::PaginationInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/shopsavvy_data_api/models.rb

Overview

Pagination info for search results

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#limitObject (readonly)

Returns the value of attribute limit.



368
369
370
# File 'lib/shopsavvy_data_api/models.rb', line 368

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



368
369
370
# File 'lib/shopsavvy_data_api/models.rb', line 368

def offset
  @offset
end

#returnedObject (readonly)

Returns the value of attribute returned.



368
369
370
# File 'lib/shopsavvy_data_api/models.rb', line 368

def returned
  @returned
end

#totalObject (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_hObject



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