Class: Rester::Client::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(status, hash = {}) ⇒ Response

Returns a new instance of Response.



4
5
6
7
8
# File 'lib/rester/client/response.rb', line 4

def initialize(status, hash={})
  @_status = status
  merge!(hash)
  _deep_freeze
end

Instance Method Details

#successful?Boolean

Returns:

  • (Boolean)


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

def successful?
  @_status && @_status.between?(200, 299)
end