Class: EmailCenterApi::ResponseValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/email_center_api/response_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseValidator

Returns a new instance of ResponseValidator.



4
5
6
# File 'lib/email_center_api/response_validator.rb', line 4

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/email_center_api/response_validator.rb', line 3

def response
  @response
end

Instance Method Details

#validate_and_return_responseObject



8
9
10
11
# File 'lib/email_center_api/response_validator.rb', line 8

def validate_and_return_response
  raise_errors unless successful?
  response
end