Class: Vigiles::Archive::Response

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/vigiles/archive/response.rb

Defined Under Namespace

Classes: ResponseBodyTooDeepError

Class Method Summary collapse

Class Method Details

.from(res) ⇒ Object



60
61
62
63
64
65
66
67
68
# File 'lib/vigiles/archive/response.rb', line 60

def self.from(res)
  Response.new(
    rack_response: res,
    content_type: res.headers["Content-Type"] || "unknown_content_type",
    headers: res.headers.as_json,
    payload: extract_payload(res),
    status: res.status
  )
end