Class: Ahora::Collection

Inherits:
Response show all
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

#cache_key, #initialize

Methods inherited from Representation

#initialize

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

#targetObject



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