class Hubscreen::Response
Parent Class for all Hubscreen
response objects. Designed for direct access to the response either through the “raw_hash” which is the hash representation of the JSON response or the “raw_response” which is the OpenStruct representation
By default all APIRequests will return a Response
object. To disable this, set Hubscreen.configure
(encapsulate_response: false)
Attributes
raw_hash[RW]
raw_response[RW]
status_code[RW]
Public Class Methods
new(response_json_hash)
click to toggle source
# File lib/hubscreen/response.rb, line 12 def initialize(response_json_hash) @raw_hash = response_json_hash @raw_response = RecursiveOpenStruct.new(response_json_hash) end
Public Instance Methods
contact()
click to toggle source
Type Cast Helpers
# File lib/hubscreen/response.rb, line 24 def contact Contact.new(self) end
pretty_response()
click to toggle source
Prints out the raw response in formatted JSON. This method is primarily used to aid in debugging
# File lib/hubscreen/response.rb, line 19 def pretty_response JSON.pretty_generate(@raw_hash) end