Class: MetricsApi::V3::Endpoints::Facets

Inherits:
Object
  • Object
show all
Defined in:
app/services/metrics_api/v3/endpoints/facets.rb

Overview

Facets endpoint. Returns a list of display_collection names

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFacets

All endpoints take in a params hash, this endpoint has no params however


10
11
12
13
14
# File 'app/services/metrics_api/v3/endpoints/facets.rb', line 10

def initialize(*)
  # TODO: maybe this should be a global metrics config? There are now 3+ locations you would need
  # to update the primary key for metrics
  @primary_key = 'display_collection'
end

Instance Attribute Details

#primary_keyObject (readonly)

Returns the value of attribute primary_key


7
8
9
# File 'app/services/metrics_api/v3/endpoints/facets.rb', line 7

def primary_key
  @primary_key
end

Instance Method Details

#callObject

TODO: Better way of collecting display_collection names


17
18
19
# File 'app/services/metrics_api/v3/endpoints/facets.rb', line 17

def call
  SupplejackApi::FacetsHelper.get_list_of_facet_values(primary_key)
end