Class: Edgar::Entity
- Inherits:
-
Object
- Object
- Edgar::Entity
- Defined in:
- lib/edgar/entity.rb
Overview
Base class wrapping SEC submissions API data for a CIK entity.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cik ⇒ Object
readonly
Returns the value of attribute cik.
Instance Method Summary collapse
- #business_address ⇒ Object
- #company? ⇒ Boolean
- #data ⇒ Object
- #display_name ⇒ Object
- #get_filings(form: nil, year: nil, quarter: nil, accession_number: nil, filing_date: nil, date: nil, amendments: nil, date_start: nil, date_end: nil) ⇒ Object
- #individual? ⇒ Boolean
-
#initialize(cik:, name: nil) ⇒ Entity
constructor
A new instance of Entity.
- #mailing_address ⇒ Object
- #name ⇒ Object
- #not_found? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(cik:, name: nil) ⇒ Entity
Returns a new instance of Entity.
8 9 10 11 12 |
# File 'lib/edgar/entity.rb', line 8 def initialize(cik:, name: nil) @cik = cik.to_i @name = name @entity_data = nil end |
Instance Attribute Details
#cik ⇒ Object (readonly)
Returns the value of attribute cik.
6 7 8 |
# File 'lib/edgar/entity.rb', line 6 def cik @cik end |
Instance Method Details
#business_address ⇒ Object
42 43 44 |
# File 'lib/edgar/entity.rb', line 42 def business_address data.business_address end |
#company? ⇒ Boolean
26 27 28 |
# File 'lib/edgar/entity.rb', line 26 def company? data.company? end |
#data ⇒ Object
18 19 20 |
# File 'lib/edgar/entity.rb', line 18 def data @data ||= EntityData.new(cik: @cik) end |
#display_name ⇒ Object
22 23 24 |
# File 'lib/edgar/entity.rb', line 22 def display_name data.name end |
#get_filings(form: nil, year: nil, quarter: nil, accession_number: nil, filing_date: nil, date: nil, amendments: nil, date_start: nil, date_end: nil) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/edgar/entity.rb', line 46 def get_filings(form: nil, year: nil, quarter: nil, accession_number: nil, filing_date: nil, date: nil, amendments: nil, date_start: nil, date_end: nil) filings = if year && quarter Filings.from_quarter(year, quarter) else build_filings_from_submissions end filings = filings.filter( form: form, filing_date: filing_date || date, cik: @cik, amendments: amendments, date_start: date_start, date_end: date_end ) if accession_number filing = filings.find { |f| f.accession_number == accession_number } return filing ? Filings.new([filing]) : Filings.new([]) end filings end |
#individual? ⇒ Boolean
30 31 32 |
# File 'lib/edgar/entity.rb', line 30 def individual? data.individual? end |
#mailing_address ⇒ Object
38 39 40 |
# File 'lib/edgar/entity.rb', line 38 def mailing_address data.mailing_address end |
#name ⇒ Object
14 15 16 |
# File 'lib/edgar/entity.rb', line 14 def name @name || data.name end |
#not_found? ⇒ Boolean
34 35 36 |
# File 'lib/edgar/entity.rb', line 34 def not_found? data.not_found? end |
#to_s ⇒ Object
72 73 74 |
# File 'lib/edgar/entity.rb', line 72 def to_s "#<Entity #{@cik}>" end |