Class: Deploygate::Client::Response

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

Overview

Api response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(f_response) ⇒ Response

Returns a new instance of Response.



9
10
11
12
13
# File 'lib/deploygate/client/response.rb', line 9

def initialize(f_response)
  @body = f_response.body
  @headers = f_response.headers
  @status = f_response.status
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/deploygate/client/response.rb', line 7

def body
  @body
end

#headersObject

Returns the value of attribute headers.



7
8
9
# File 'lib/deploygate/client/response.rb', line 7

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



7
8
9
# File 'lib/deploygate/client/response.rb', line 7

def status
  @status
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/deploygate/client/response.rb', line 15

def success?
  (200..299).include?(status)
end