Method: FormStalker::Response#initialize

Defined in:
lib/form_stalker/response.rb

#initialize(http_response) ⇒ Response

Returns a new instance of Response.



59
60
61
62
63
64
65
66
67
# File 'lib/form_stalker/response.rb', line 59

def initialize(http_response)
  @http_response = http_response

  @status = RAILS_HTTP_STATUS[@http_response.code]

  @data = JSON.parse(@http_response.body) if @status == :ok

  parse_error
end