Module: CyprusPostalCodes::Client::Paginator

Included in:
CyprusPostalCodes::Client
Defined in:
lib/cyprus_postal_codes/client/paginator.rb

Instance Method Summary collapse

Instance Method Details

#first_pageObject



17
18
19
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 17

def first_page
  paginator&.dig("tokens", "first_page")
end

#last_pageObject



21
22
23
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 21

def last_page
  paginator&.dig("tokens", "last_page")
end

#next_pageObject



9
10
11
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 9

def next_page
  paginator&.dig("tokens", "next_page")
end

#previous_pageObject



13
14
15
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 13

def previous_page
  paginator&.dig("tokens", "previous_page")
end

#total_countObject



29
30
31
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 29

def total_count
  paginator&.fetch("total_count") || 0
end

#total_pagesObject



25
26
27
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 25

def total_pages
  paginator&.fetch("total_pages") || 0
end