Class: IRXML::Edgar::Document
- Inherits:
-
Object
- Object
- IRXML::Edgar::Document
- Defined in:
- lib/irxml/edgar.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #filing_url ⇒ Object
-
#initialize(node) ⇒ Document
constructor
A new instance of Document.
- #set_values(node) ⇒ Object
Constructor Details
#initialize(node) ⇒ Document
Returns a new instance of Document.
25 26 27 |
# File 'lib/irxml/edgar.rb', line 25 def initialize(node) set_values(node) end |
Instance Method Details
#attributes ⇒ Object
29 30 31 |
# File 'lib/irxml/edgar.rb', line 29 def attributes @attributes ||= {} end |
#filing_url ⇒ Object
33 34 35 |
# File 'lib/irxml/edgar.rb', line 33 def filing_url "http://investor.shareholder.com/#{IRXML.company_id.downcase}/secfiling.cfm?filingID=#{attributes['fid']}" end |
#set_values(node) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/irxml/edgar.rb', line 37 def set_values(node) node.children.each do |tag| attributes[tag.name.downcase] = tag.content self.class.class_eval { define_method(tag.name.downcase) { attributes[tag.name.downcase] } } end end |