Class: Interpreter
- Inherits:
-
Object
- Object
- Interpreter
- Defined in:
- lib/soaspec/interpreter.rb
Overview
Help interpret the general type of a particular object
Class Method Summary collapse
-
.response_type_for(response) ⇒ Symbol
Type of provided response.
Class Method Details
.response_type_for(response) ⇒ Symbol
Returns Type of provided response.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/soaspec/interpreter.rb', line 7 def self.response_type_for(response) if response.is_a? String case response.body[0] when '<' :xml when '{', '[' :json else :unknown end elsif response.is_a? Hash :hash elsif response.is_a? Nokogiri::XML::NodeSet :xml else :unknown end end |