Class: Edgar::FilingIndex

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#quarterObject (readonly)

Returns the value of attribute quarter.



8
9
10
# File 'lib/edgar/filing_index.rb', line 8

def quarter
  @quarter
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/edgar/filing_index.rb', line 8

def type
  @type
end

#yearObject (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

#entriesObject



16
17
18
# File 'lib/edgar/filing_index.rb', line 16

def entries
  @entries ||= parse_index
end