Module: ZerigoDNS::Resource::ClassMethods
- Defined in:
- lib/zerigodns/resource.rb
Instance Method Summary collapse
-
#process_array(response, body) ⇒ Array
Processes an array response by delegating to the includer’s self.from_response.
-
#process_response(response) ⇒ Object
Removes the root from the response and hands it off to the class to process it Processes an array response by delegating to the includer’s self.from_response.
Instance Method Details
#process_array(response, body) ⇒ Array
Processes an array response by delegating to the includer’s self.from_response
24 25 26 27 28 |
# File 'lib/zerigodns/resource.rb', line 24 def process_array response, body body.map do |element| from_response response, element end end |
#process_response(response) ⇒ Object
Removes the root from the response and hands it off to the class to process it Processes an array response by delegating to the includer’s self.from_response
10 11 12 13 14 15 16 17 |
# File 'lib/zerigodns/resource.rb', line 10 def process_response response without_root = response.body.values.first case when without_root.is_a?(Array) then process_array(response, without_root) when without_root.is_a?(Hash) then from_response(response, without_root) else without_root end end |