Class: Ahora::Collection
- Inherits:
-
Response
- Object
- Nibbler
- Representation
- Response
- Ahora::Collection
- Defined in:
- lib/ahora/representation.rb
Constant Summary
Constants inherited from Representation
Representation::BOOL_PARSER, Representation::DATE_PARSER, Representation::FLOAT_PARSER, Representation::INTEGER_PARSER, Representation::STRING_PARSER, Representation::TIME_PARSER
Instance Method Summary collapse
Methods inherited from Response
Methods inherited from Representation
Methods included from Representation::Definition
#attribute, #attribute_selector, #boolean, #date, #element, #float, #integer, #string, #time
Constructor Details
This class inherits a constructor from Ahora::Response
Instance Method Details
#target ⇒ Object
120 121 122 123 124 |
# File 'lib/ahora/representation.rb', line 120 def target @document_parser.call(@response.body).search("/*[@type='array']/*").map { |element| @instantiator.call element }.to_a.compact end |