Module: CyprusPostalCodes::Client::Paginator
- Included in:
- CyprusPostalCodes::Client
- Defined in:
- lib/cyprus_postal_codes/client/paginator.rb
Instance Method Summary collapse
- #first_page ⇒ Object
- #last_page ⇒ Object
- #next_page ⇒ Object
- #previous_page ⇒ Object
- #total_count ⇒ Object
- #total_pages ⇒ Object
Instance Method Details
#first_page ⇒ Object
17 18 19 |
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 17 def first_page paginator&.dig("tokens", "first_page") end |
#last_page ⇒ Object
21 22 23 |
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 21 def last_page paginator&.dig("tokens", "last_page") end |
#next_page ⇒ Object
9 10 11 |
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 9 def next_page paginator&.dig("tokens", "next_page") end |
#previous_page ⇒ Object
13 14 15 |
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 13 def previous_page paginator&.dig("tokens", "previous_page") end |
#total_count ⇒ Object
29 30 31 |
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 29 def total_count paginator&.fetch("total_count") || 0 end |
#total_pages ⇒ Object
25 26 27 |
# File 'lib/cyprus_postal_codes/client/paginator.rb', line 25 def total_pages paginator&.fetch("total_pages") || 0 end |