Class: Ravelin::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ravelin/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ Response

Returns a new instance of Response.



18
19
20
21
22
23
24
25
26
# File 'lib/ravelin/response.rb', line 18

def initialize(faraday_response)
  return if faraday_response.body.nil? || faraday_response.body.empty?
  response_body = faraday_response.body
  tag(response_body) if response_body.key?('tagNames')
  event(response_body) if response_body.key?('data')

  @http_status  = faraday_response.status
  @http_body    = faraday_response.body
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def action
  @action
end

#atoObject (readonly)

Returns the value of attribute ato.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def ato
  @ato
end

#client_reviewed_statusObject (readonly)

Returns the value of attribute client_reviewed_status.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def client_reviewed_status
  @client_reviewed_status
end

#commentObject (readonly)

Returns the value of attribute comment.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def comment
  @comment
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def customer_id
  @customer_id
end

#http_bodyObject (readonly)

Returns the value of attribute http_body.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def http_body
  @http_body
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def http_status
  @http_status
end

#labelObject (readonly)

Returns the value of attribute label.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def label
  @label
end

#scoreObject (readonly)

Returns the value of attribute score.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def score
  @score
end

#score_idObject (readonly)

Returns the value of attribute score_id.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def score_id
  @score_id
end

#sourceObject (readonly)

Returns the value of attribute source.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def source
  @source
end

#tag_namesObject (readonly)

Returns the value of attribute tag_names.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def tag_names
  @tag_names
end

#tagsObject (readonly)

Returns the value of attribute tags.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def tags
  @tags
end

#warningsObject (readonly)

Returns the value of attribute warnings.



3
4
5
# File 'lib/ravelin/response.rb', line 3

def warnings
  @warnings
end