Module: Fog::Backblaze::JSONResponse

Defined in:
lib/fog/backblaze/json_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#jsonObject


13
14
15
# File 'lib/fog/backblaze/json_response.rb', line 13

def json
  @json ||= ::JSON.parse(raw_body)
end

Instance Method Details

#assign_json_body!Object


17
18
19
# File 'lib/fog/backblaze/json_response.rb', line 17

def assign_json_body!
  self.body = json
end

#json_response?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/fog/backblaze/json_response.rb', line 21

def json_response?
  headers['Content-Type'].start_with?("application/json")
end

#raw_bodyObject


9
10
11
# File 'lib/fog/backblaze/json_response.rb', line 9

def raw_body
  @body
end