Class: RedboothRuby::Request::Validator
- Inherits:
-
Object
- Object
- RedboothRuby::Request::Validator
- Defined in:
- lib/redbooth-ruby/request/validator.rb
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#raw_response ⇒ Object
Returns the value of attribute raw_response.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(info) ⇒ Validator
constructor
A new instance of Validator.
-
#validated_response_for(incoming_response) ⇒ Object
Validates the given http response creating a response object or failing with an error and description.
Constructor Details
#initialize(info) ⇒ Validator
Returns a new instance of Validator.
7 8 9 |
# File 'lib/redbooth-ruby/request/validator.rb', line 7 def initialize(info) @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
4 5 6 |
# File 'lib/redbooth-ruby/request/validator.rb', line 4 def info @info end |
#raw_response ⇒ Object
Returns the value of attribute raw_response.
5 6 7 |
# File 'lib/redbooth-ruby/request/validator.rb', line 5 def raw_response @raw_response end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/redbooth-ruby/request/validator.rb', line 5 def response @response end |
Instance Method Details
#validated_response_for(incoming_response) ⇒ Object
Validates the given http response creating a response object or failing with an error and description
param incoming_response [] http response object return [RedboothRuby::Request::Response]
16 17 18 19 20 21 22 23 |
# File 'lib/redbooth-ruby/request/validator.rb', line 16 def validated_response_for(incoming_response) self.raw_response = incoming_response @response = response_from_raw verify_response_code info.data = response.data validate_response_data response end |