class Teamtailor::PageResult
Attributes
json_response[R]
Public Class Methods
new(response_body)
click to toggle source
# File lib/teamtailor/page_result.rb, line 7 def initialize(response_body) @json_response = JSON.parse(response_body) end
Public Instance Methods
data()
click to toggle source
# File lib/teamtailor/page_result.rb, line 15 def data json_response.dig("data") end
first_page_url()
click to toggle source
# File lib/teamtailor/page_result.rb, line 31 def first_page_url json_response.dig("links", "first") end
has_next_page?()
click to toggle source
# File lib/teamtailor/page_result.rb, line 39 def has_next_page? !next_page_url.nil? end
last_page_url()
click to toggle source
# File lib/teamtailor/page_result.rb, line 35 def last_page_url json_response.dig("links", "last") end
next_page_url()
click to toggle source
# File lib/teamtailor/page_result.rb, line 27 def next_page_url json_response.dig("links", "next") end
page_count()
click to toggle source
# File lib/teamtailor/page_result.rb, line 19 def page_count json_response.dig("meta", "page-count") end
record_count()
click to toggle source
# File lib/teamtailor/page_result.rb, line 23 def record_count json_response.dig("meta", "record-count") end
records()
click to toggle source
# File lib/teamtailor/page_result.rb, line 11 def records Teamtailor::Parser.parse json_response end