Class: OpenSandbox::PaginationInfo

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

Overview

Value object for pagination

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#has_next_pageObject (readonly)

Returns the value of attribute has_next_page

Returns:

  • (Object)

    the current value of has_next_page



61
62
63
# File 'lib/open_sandbox/models.rb', line 61

def has_next_page
  @has_next_page
end

#pageObject (readonly)

Returns the value of attribute page

Returns:

  • (Object)

    the current value of page



61
62
63
# File 'lib/open_sandbox/models.rb', line 61

def page
  @page
end

#page_sizeObject (readonly)

Returns the value of attribute page_size

Returns:

  • (Object)

    the current value of page_size



61
62
63
# File 'lib/open_sandbox/models.rb', line 61

def page_size
  @page_size
end

#total_itemsObject (readonly)

Returns the value of attribute total_items

Returns:

  • (Object)

    the current value of total_items



61
62
63
# File 'lib/open_sandbox/models.rb', line 61

def total_items
  @total_items
end

#total_pagesObject (readonly)

Returns the value of attribute total_pages

Returns:

  • (Object)

    the current value of total_pages



61
62
63
# File 'lib/open_sandbox/models.rb', line 61

def total_pages
  @total_pages
end

Class Method Details

.from_hash(h) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/open_sandbox/models.rb', line 62

def self.from_hash(h)
  new(
    page:          h["page"],
    page_size:     h["pageSize"],
    total_items:   h["totalItems"],
    total_pages:   h["totalPages"],
    has_next_page: h["hasNextPage"]
  )
end