lib/trav3/pagination.rb in trav3-0.2.0 vs lib/trav3/pagination.rb in trav3-0.2.1

- old
+ new

@@ -1,6 +1,7 @@ # frozen_string_literal: true + module Trav3 class Pagination def initialize(travis, result) @travis = travis @result = result @@ -9,22 +10,22 @@ def dig(opt) @result.dig(opt) end def next - get("#{API_ROOT}#{self.dig("@pagination").dig("next").dig("@href")}") + get("#{API_ROOT}#{dig('@pagination').dig('next').dig('@href')}") end def first - get("#{API_ROOT}#{self.dig("@pagination").dig("first").dig("@href")}") + get("#{API_ROOT}#{dig('@pagination').dig('first').dig('@href')}") end def last - get("#{API_ROOT}#{self.dig("@pagination").dig("last").dig("@href")}") + get("#{API_ROOT}#{dig('@pagination').dig('last').dig('@href')}") end - def get(x) - Trav3::GET.(travis, x) + def get(url) + Trav3::GET.call(travis, url) end private :get attr_reader :travis private :travis