Class: EpoOps::SearchQueryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/epo_ops/search_query_builder.rb

Overview

This Builder helps creating a search query using / CQL (Common Query Language or Contextual Query Language) with the identifiers specified by the EPO in the OPS Documentation chapter 4.2 (Link)

  • use tab Downloads and see file ‘OPS version 3.1 documentation’).

Class Method Summary collapse

Class Method Details

.build(ipc_class, date, range_start = nil, range_end = nil) ⇒ String

Build the query with the given parameters. Invalid ranges are fixed automatically and you will be notified about the changes

Returns:

  • (String)


14
15
16
17
# File 'lib/epo_ops/search_query_builder.rb', line 14

def self.build(ipc_class, date, range_start = nil, range_end = nil)
  validated_range = validate_range range_start, range_end
  "q=#{build_params(ipc_class, date)}&Range=#{validated_range[0]}-#{validated_range[1]}"
end