class Cfan122::Operation::Response
Attributes
operation[R]
request[R]
response[R]
Public Class Methods
new(operation)
click to toggle source
# File lib/cfan122/operation.rb, line 53 def initialize operation @operation = operation @response = operation.execute @request = response.request raise ResponseError.new('Request Error!', response.code) if response.code != 200 end
Public Instance Methods
to_json()
click to toggle source
# File lib/cfan122/operation.rb, line 60 def to_json response.body.blank? ? {} : JSON.parse(response.body) end