Class: Edgar::DataObjects::Form13F

Inherits:
Base
  • Object
show all
Defined in:
lib/edgar/data_objects.rb

Overview

Wraps a Form 13F institutional holdings filing.

Instance Attribute Summary

Attributes inherited from Base

#filing

Instance Method Summary collapse

Methods inherited from Base

#accession_number, #company_name, #filing_date, #form_type, #initialize, #to_s

Constructor Details

This class inherits a constructor from Edgar::DataObjects::Base

Instance Method Details

#filing_managerObject



126
127
128
# File 'lib/edgar/data_objects.rb', line 126

def filing_manager
  @filing.header.filer_company
end

#holdingsObject



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/edgar/data_objects.rb', line 130

def holdings
  xml = @filing.xml
  return [] if xml.empty?

  doc = Nokogiri::XML(xml)
  doc.remove_namespaces!
  entries = []
  doc.xpath("//infoTable").each do |table|
    entry = {
      name_of_issuer: table.at_xpath("nameOfIssuer")&.text,
      title_of_class: table.at_xpath("titleOfClass")&.text,
      cusip: table.at_xpath("cusip")&.text,
      value: table.at_xpath("value")&.text&.to_i,
      shares: table.at_xpath("shrsOrPrnAmt/shrsPrnAmt")&.text&.to_i,
      put_call: table.at_xpath("putCall")&.text,
      investment_discretion: table.at_xpath("investmentDiscretion")&.text,
      voting_authority_sole: table.at_xpath("votingAuthority/sole")&.text&.to_i,
      voting_authority_shared: table.at_xpath("votingAuthority/shared")&.text&.to_i,
      voting_authority_none: table.at_xpath("votingAuthority/none")&.text&.to_i
    }
    entries << entry
  end
  entries
rescue StandardError
  []
end

#report_dateObject



122
123
124
# File 'lib/edgar/data_objects.rb', line 122

def report_date
  @filing.header.period_of_report
end