class FontsDotCom::Response

Attributes

body[RW]
code[RW]
original_response_object[RW]

Public Class Methods

new(response, options={}) click to toggle source
# File lib/fonts_dot_com/response.rb, line 18
def initialize(response, options={})
  @original_response_object = response

  json  = JSON.parse(response.body)

  @body = json
  @code = response.code

  raise error.new(self) if returned_error
end

Public Instance Methods

error() click to toggle source
# File lib/fonts_dot_com/response.rb, line 41
def error
  # TODO
  ApiError
end
returned_error() click to toggle source
# File lib/fonts_dot_com/response.rb, line 37
def returned_error
  code[0].to_i > 2
end
session_key() click to toggle source
# File lib/fonts_dot_com/response.rb, line 33
def session_key
  records[0].fetch(:sessionKey) 
end
status() click to toggle source
# File lib/fonts_dot_com/response.rb, line 29
def status
  raise 'TODO'
end

Private Instance Methods

authentication_error_code() click to toggle source
# File lib/fonts_dot_com/response.rb, line 48
def authentication_error_code
  raise 'todo'
end