class UnderOs::HTTP::Response
Attributes
data[R]
Public Class Methods
new(response, data)
click to toggle source
# File lib/under_os/http/response.rb, line 4 def initialize(response, data) @response = response @data = data # raw NSData end
Public Instance Methods
body()
click to toggle source
# File lib/under_os/http/response.rb, line 13 def body @body ||= @data.to_s end
content_length()
click to toggle source
# File lib/under_os/http/response.rb, line 21 def content_length headers["Content-Length"].to_i end
content_type()
click to toggle source
# File lib/under_os/http/response.rb, line 25 def content_type headers["Content-Type"] end
headers()
click to toggle source
# File lib/under_os/http/response.rb, line 9 def headers @response.allHeaderFields end
json()
click to toggle source
# File lib/under_os/http/response.rb, line 17 def json JSON.parse(body) end