Module: Parliament::OpenSearch

Defined in:
lib/parliament/open_search.rb,
lib/parliament/open_search/version.rb,
lib/parliament/open_search/description_cache.rb,
lib/parliament/open_search/description_error.rb

Overview

Namespace for classes and modules that handle connections to, and processing of data from OpenSearch APIs.

Since:

  • 0.1.0

Defined Under Namespace

Modules: DescriptionCache Classes: DescriptionError

Constant Summary collapse

VERSION =

Since:

  • 0.1.0

'0.5.0'.freeze

Class Method Summary collapse

Class Method Details

.load!Object

Since:

  • 0.1.0



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/parliament/open_search.rb', line 7

def load!
  if parliament_response?
    register_parliament_response
  else
    raise(LoadError, "Missing requirement 'Parliament::Response'. Have you added `gem 'parliament-ruby'` to your Gemfile?")
  end

  if parliament_request?
    register_parliament_request
    register_opensearch_request
  else
    raise(LoadError, "Missing requirement 'Parliament::Request'. Have you added `gem 'parliament-ruby'` to your Gemfile?")
  end

  if parliament_builder?
    register_parliament_builder
    register_opensearch_builder
  else
    raise(LoadError, "Missing requirement 'Parliament::Builder'. Have you added `gem 'parliament-ruby'` to your Gemfile?")
  end

  register_opensearch
  register_rexml_document
  register_active_support_inflector
  register_feedjira
end

.parliament_builder?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



42
43
44
# File 'lib/parliament/open_search.rb', line 42

def parliament_builder?
  defined?(::Parliament::Builder)
end

.parliament_request?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



38
39
40
# File 'lib/parliament/open_search.rb', line 38

def parliament_request?
  defined?(::Parliament::Request)
end

.parliament_response?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



34
35
36
# File 'lib/parliament/open_search.rb', line 34

def parliament_response?
  defined?(::Parliament::Response)
end