Class: Sec::Reader
- Inherits:
-
Object
- Object
- Sec::Reader
- Defined in:
- lib/sec/reader.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- MONTHLY_PATH =
%q{/Archives/edgar/monthly/xbrlrss-%{year}-%{month}.xml}
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Class Method Summary collapse
Instance Method Summary collapse
- #get_monthly_index(year, month) ⇒ Object
- #get_xbrl_file(url) ⇒ Object
-
#initialize(attrs = {}) ⇒ Reader
constructor
A new instance of Reader.
Constructor Details
#initialize(attrs = {}) ⇒ Reader
Returns a new instance of Reader.
23 24 25 |
# File 'lib/sec/reader.rb', line 23 def initialize(attrs={}) self.connection = Connection.new(attrs) end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
11 12 13 |
# File 'lib/sec/reader.rb', line 11 def connection @connection end |
Class Method Details
Instance Method Details
#get_monthly_index(year, month) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/sec/reader.rb', line 27 def get_monthly_index(year, month) response = connection.get(monthly_query_uri(year, month)) Crack::XML.parse(response) rescue => error raise Error, error. end |
#get_xbrl_file(url) ⇒ Object
34 35 36 |
# File 'lib/sec/reader.rb', line 34 def get_xbrl_file(url) connection.get(uri_path(url)) end |