Class: TestLink::Adapters::Base
- Inherits:
-
Object
- Object
- TestLink::Adapters::Base
- Defined in:
- lib/test_link/adapters/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
23 24 25 |
# File 'lib/test_link/adapters/base.rb', line 23 def response @response end |
Instance Method Details
#adapt ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/test_link/adapters/base.rb', line 25 def adapt raise TestLink::Exceptions::EmptyResponseException.new if response.nil? || response.empty? raise TestLink::Exceptions::CommandFailedException.new response['msg'] if (response.instance_of? Hash) && (response['status_ok'] == 0) response.map do |row| raise TestLink::Exceptions::ErrorResponseException.new row['message'], row['code'] if row.keys.include? 'code' adapt_row row end end |