class Cwallet::Wallet::NetHTTPResponse
Net-Http response object
Public Instance Methods
body()
click to toggle source
# File lib/cwallet/wallet/adapters/net_http.rb, line 54 def body JSON.parse(@response.body) rescue {} end
body=(body)
click to toggle source
# File lib/cwallet/wallet/adapters/net_http.rb, line 58 def body=(body) @response.body = body.to_json end
data()
click to toggle source
# File lib/cwallet/wallet/adapters/net_http.rb, line 62 def data body['data'] end
headers()
click to toggle source
# File lib/cwallet/wallet/adapters/net_http.rb, line 66 def headers out = @response.to_hash.map do |key, val| [ key.upcase.gsub('_', '-'), val.count == 1 ? val.first : val ] end out.to_h end
status()
click to toggle source
# File lib/cwallet/wallet/adapters/net_http.rb, line 73 def status @response.code.to_i end