Class: ThirteenF::Search
- Inherits:
-
Object
- Object
- ThirteenF::Search
- Defined in:
- lib/thirteen_f/search.rb
Constant Summary collapse
- SEARCH_URL =
'https://efts.sec.gov/LATEST/search-index'
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#search_params ⇒ Object
readonly
Returns the value of attribute search_params.
Instance Method Summary collapse
- #get_results ⇒ Object
-
#initialize(search_string) ⇒ Search
constructor
A new instance of Search.
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
#results ⇒ Object (readonly)
Returns the value of attribute results.
5 6 7 |
# File 'lib/thirteen_f/search.rb', line 5 def results @results end |
#search_params ⇒ Object (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_results ⇒ Object
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 |