Class: Sec::Firms::FirmEntryParser
- Defined in:
- lib/sec/firms/firm_entry_parser.rb
Instance Attribute Summary collapse
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Attributes inherited from XMLParser
Instance Method Summary collapse
-
#initialize(xml_str, updated_at) ⇒ FirmEntryParser
constructor
A new instance of FirmEntryParser.
- #to_hash ⇒ Object
Constructor Details
#initialize(xml_str, updated_at) ⇒ FirmEntryParser
Returns a new instance of FirmEntryParser.
6 7 8 9 |
# File 'lib/sec/firms/firm_entry_parser.rb', line 6 def initialize(xml_str, updated_at) super(xml_str) if xml_str @updated_at = updated_at end |
Instance Attribute Details
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/sec/firms/firm_entry_parser.rb', line 4 def updated_at @updated_at end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/sec/firms/firm_entry_parser.rb', line 11 def to_hash data = Hash.from_xml(doc.to_s)['edgarSubmission']['formData'] rescue nil return {} unless data data = Helpers::transform_hash(data) do |hash, key, value| hash[key] = default_values(value) end end |