Class: Queries::Serial::Filter

Inherits:
Query::Filter show all
Includes:
Concerns::DataAttributes
Defined in:
lib/queries/serial/filter.rb

Constant Summary collapse

PARAMS =
[
  :name,
  :serial_id,
  serial_id: []
].freeze

Constants inherited from Query::Filter

Query::Filter::FILTER_QUERIES, Query::Filter::SUBQUERIES

Instance Attribute Summary collapse

Attributes inherited from Query::Filter

#api, #asserted_distribution_query, #biological_association_query, #biological_associations_graph_query, #collecting_event_query, #collection_object_query, #content_query, #controlled_vocabulary_term_query, #data_attribute_query, #descriptor_query, #extract_query, #field_occurrence_query, #image_query, #loan_query, #object_global_id, #observation_query, #otu_query, #page, #paginate, #params, #per, #person_query, #project_id, #recent, #taxon_name_query, #venn, #venn_mode

Attributes inherited from Query

#query_string, #terms

Instance Method Summary collapse

Methods inherited from Query::Filter

#all, #all_and_clauses, #all_merge_clauses, #annotator_and_clauses, #annotator_merge_clauses, annotator_params, api_except_params, api_excluded_params, #apply_venn, #attribute_exact_facet, base_filter, #deep_permit, included_annotator_facets, inverted_subqueries, #merge_clauses, #model_id_facet, #object_global_id_facet, params, #permitted_params, #process_url_into_params, query_name, #query_name, #set_nested_queries, #shared_and_clauses, #subquery_vector, #venn_query

Methods inherited from Query

#alphabetic_strings, #alphanumeric_strings, base_name, #base_name, #base_query, #build_terms, #cached_facet, #end_wildcard, #levenshtein_distance, #match_ordered_wildcard_pieces_in_cached, #no_terms?, referenced_klass, #referenced_klass, #referenced_klass_except, #referenced_klass_intersection, #referenced_klass_union, #start_and_end_wildcard, #start_wildcard, #table, #wildcard_pieces

Constructor Details

#initialize(query_params) ⇒ Filter

Returns a new instance of Filter.



20
21
22
23
24
25
# File 'lib/queries/serial/filter.rb', line 20

def initialize(query_params)
  super
  @name = params[:name]
  @serial_id = params[:serial_id]
  set_data_attributes_params(params)
end

Instance Attribute Details

#nameObject

Parameters:

  • matching (String)

    name exactly



18
19
20
# File 'lib/queries/serial/filter.rb', line 18

def name
  @name
end

#serial_idObject

Returns Array.

Returns:

  • Array



14
15
16
# File 'lib/queries/serial/filter.rb', line 14

def serial_id
  @serial_id
end

Instance Method Details

#and_clausesObject



41
42
43
# File 'lib/queries/serial/filter.rb', line 41

def and_clauses
  [ name_facet ]
end

#name_facetObject



36
37
38
39
# File 'lib/queries/serial/filter.rb', line 36

def name_facet
  return nil if name.blank?
  table[:name].eq(name)
end

#project_id_facetObject

Required, disable default facet



32
33
34
# File 'lib/queries/serial/filter.rb', line 32

def project_id_facet
  nil
end