lib/trav3/result.rb in trav3-0.0.2 vs lib/trav3/result.rb in trav3-0.0.3
- old
+ new
@@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'forwardable'
+require 'trav3/pagination'
class InvalidRepository < StandardError
def message
"The repository format was invlaid.
You must either provide the digit name for the repository,
@@ -25,14 +26,23 @@
:initialize_http_header, :get_fields, :each_header
def initialize(response)
@response = response
@json = JSON.parse(response.body)
end
+
+ def inspect
+ "<#{self.class} Response>"
+ end
+
def success?; raise Unimplemented end
def failure?; raise Unimplemented end
end
class Success < Response
+ def page
+ Trav3::Pagination.new(self)
+ end
+
def success?; true end
def failure?; false end
end
class RequestError < Response