Class: Basecamp3::ResponseParser
- Inherits:
-
Object
- Object
- Basecamp3::ResponseParser
- Defined in:
- lib/basecamp3/response_parser.rb
Overview
The basecamp response parser
Class Method Summary collapse
-
.parse(response, model) ⇒ Basecamp3::Model, ...
Parses the given response to the given wrapper model.
Class Method Details
.parse(response, model) ⇒ Basecamp3::Model, ...
Parses the given response to the given wrapper model.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/basecamp3/response_parser.rb', line 11 def self.parse(response, model) case response when Hash map_object(response, model) when Array response.map do |item| map_object(item, model) end when NilClass nil else raise 'Unsupported response type' end end |