Class: ThirteenF::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/thirteen_f/search.rb

Constant Summary collapse

SEARCH_URL =
'https://efts.sec.gov/LATEST/search-index'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search_string) ⇒ Search

Returns a new instance of Search.



9
10
11
# File 'lib/thirteen_f/search.rb', line 9

def initialize(search_string)
  @search_params = [SEARCH_URL, { keysTyped: search_string, narrow: true }]
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



5
6
7
# File 'lib/thirteen_f/search.rb', line 5

def results
  @results
end

#search_paramsObject (readonly)

Returns the value of attribute search_params.



5
6
7
# File 'lib/thirteen_f/search.rb', line 5

def search_params
  @search_params
end

Instance Method Details

#get_resultsObject



13
14
15
16
17
# File 'lib/thirteen_f/search.rb', line 13

def get_results
  response = SecRequest.post(*search_params)
  @results = configure_search_results response
  true
end