Sha256: 109742df89969e5178c2f1b97db39b5d12fc47171fc3e31ecc0ece5d01a3601d
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
module WhosGotDirt module Responses module Entity # Converts entities from the OpenDuka API to Popolo format. # # @see http://www.openduka.org/index.php/api/documentation class OpenDuka < Response @template = { '@type' => 'Entity', 'name' => '/Name', 'identifiers' => [{ 'identifier' => '/ID', 'scheme' => 'OpenDuka', }], } # Parses the response body. # # @return [Array<Hash>] the parsed response body def parse_body JSON.load(body) end # Returns the total number of matching results. # # @return [Fixnum] the total number of matching results def count parsed_body.size end # Transforms the parsed response body into results. # # @return [Array<Hash>] the results def to_a parsed_body.map do |data| Result.new('Entity', renderer.result(data), self).finalize! end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
whos_got_dirt-0.0.2 | lib/whos_got_dirt/responses/entity/open_duka.rb |