Class: Ecfr::SearchService::Timeline

Inherits:
FacetBase show all
Extended by:
ResponseHelper
Includes:
AttributeMethodDefinition
Defined in:
lib/ecfr/search_service/timeline.rb,
lib/ecfr/testing/extensions/search_service/timeline_extensions.rb

Defined Under Namespace

Classes: Entry

Constant Summary

Constants inherited from FacetBase

FacetBase::COUNTS_PATH, FacetBase::VALID_SEARCH_OPTIONS

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from ResponseHelper

stubbed_response

Methods included from AttributeMethodDefinition

included, #initialize

Methods inherited from Base

base_url, service_name, service_path

Instance Attribute Details

#timeline[Entry] (readonly)

Returns:



21
# File 'lib/ecfr/search_service/timeline.rb', line 21

attribute :timeline, type: Array(Entry)

Class Method Details

.response_for(timeline) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/ecfr/testing/extensions/search_service/timeline_extensions.rb', line 4

def self.response_for(timeline)
  results = {
    timeline: timeline
  }.to_json

  build(
    response: stubbed_response(results)
  )
end

.search(options = {}) ⇒ <Timeline::Entry>

Returns:



24
25
26
# File 'lib/ecfr/search_service/timeline.rb', line 24

def self.search(options = {})
  super(:timeline, options)
end