class GHI::Client::Response
Public Class Methods
new(response)
click to toggle source
# File lib/ghi/client.rb, line 25 def initialize response @response = response end
Public Instance Methods
body()
click to toggle source
# File lib/ghi/client.rb, line 29 def body @body ||= JSON.parse @response.body end
last_page()
click to toggle source
# File lib/ghi/client.rb, line 34 def last_page() links['last'] end
next_page()
click to toggle source
# File lib/ghi/client.rb, line 33 def next_page() links['next'] end
Private Instance Methods
links()
click to toggle source
# File lib/ghi/client.rb, line 38 def links return @links if defined? @links @links = {} if links = @response['Link'] links.scan(/<([^>]+)>; rel="([^"]+)"/).each { |l, r| @links[r] = l } end @links end