Class: Gorilla::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/gorilla/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



6
7
8
# File 'lib/gorilla/response.rb', line 6

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/gorilla/response.rb', line 4

def response
  @response
end

Instance Method Details

#bodyObject



10
11
12
# File 'lib/gorilla/response.rb', line 10

def body
  response.body
end

#errorObject



26
27
28
# File 'lib/gorilla/response.rb', line 26

def error
  body[:error]
end

#error?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/gorilla/response.rb', line 22

def error?
  body[:error] != nil
end

#statusObject



14
15
16
# File 'lib/gorilla/response.rb', line 14

def status
  response.status
end

#success?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/gorilla/response.rb', line 18

def success?
  !error?
end