Class: Strapi::Response

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

Overview

The parsed response returned from the Strapi API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ Response

Returns a new instance of Response.

Raises:



8
9
10
11
12
13
# File 'lib/strapi/response.rb', line 8

def initialize(faraday_response)
  @parsed_response = faraday_response.body
  return if faraday_response.success?

  raise Error, error
end

Instance Attribute Details

#parsed_responseObject (readonly)

Returns the value of attribute parsed_response.



6
7
8
# File 'lib/strapi/response.rb', line 6

def parsed_response
  @parsed_response
end