Class: Edgar::FilingIndex
- Inherits:
-
Object
- Object
- Edgar::FilingIndex
- Defined in:
- lib/edgar/filing_index.rb
Overview
Parses SEC quarterly EDGAR index .gz files into index entries.
Defined Under Namespace
Classes: IndexEntry
Constant Summary collapse
- INDEX_LINE_RE =
/\A(.+?)\s{2,}(\S{1,20})\s{2,}(\d{1,10})\s{2,}(\d{4}-\d{2}-\d{2})\s{2,}(\S+)\s*\z/
Instance Attribute Summary collapse
-
#quarter ⇒ Object
readonly
Returns the value of attribute quarter.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
- #entries ⇒ Object
-
#initialize(year, quarter, type: "company") ⇒ FilingIndex
constructor
A new instance of FilingIndex.
Constructor Details
#initialize(year, quarter, type: "company") ⇒ FilingIndex
Returns a new instance of FilingIndex.
10 11 12 13 14 |
# File 'lib/edgar/filing_index.rb', line 10 def initialize(year, quarter, type: "company") @year = year.to_i @quarter = quarter.to_i @type = type end |
Instance Attribute Details
#quarter ⇒ Object (readonly)
Returns the value of attribute quarter.
8 9 10 |
# File 'lib/edgar/filing_index.rb', line 8 def quarter @quarter end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/edgar/filing_index.rb', line 8 def type @type end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
8 9 10 |
# File 'lib/edgar/filing_index.rb', line 8 def year @year end |
Class Method Details
.for(year, quarter, type: "company") ⇒ Object
20 21 22 |
# File 'lib/edgar/filing_index.rb', line 20 def self.for(year, quarter, type: "company") new(year, quarter, type: type).entries end |
Instance Method Details
#entries ⇒ Object
16 17 18 |
# File 'lib/edgar/filing_index.rb', line 16 def entries @entries ||= parse_index end |