Class: Parliament::Builder::OpenSearchResponseBuilder

Inherits:
BaseResponseBuilder
  • Object
show all
Defined in:
lib/parliament/builder/open_search_response_builder.rb

Overview

OpenSearch response builder using Feedjira to parse the response.

Since:

  • 0.1.0

Constant Summary collapse

OPEN_SEARCH_ELEMENTS =

Since:

  • 0.1.0

%w(totalResults Query startIndex itemsPerPage).freeze

Instance Method Summary collapse

Instance Method Details

#buildObject

Builds a Feedjira::Feed response. It adds the extra OpenSearch feed elements, then parses the HTTP Response.

Since:

  • 0.1.0



10
11
12
13
14
15
16
# File 'lib/parliament/builder/open_search_response_builder.rb', line 10

def build
  OPEN_SEARCH_ELEMENTS.each do |element|
    Feedjira::Feed.add_common_feed_element(element)
  end

  Feedjira::Feed.parse(@response.body)
end