Class: DartApi::Report
- Inherits:
-
Object
- Object
- DartApi::Report
- Defined in:
- lib/dart_api/report.rb
Instance Attribute Summary collapse
-
#company_code ⇒ Object
readonly
Returns the value of attribute company_code.
-
#company_name ⇒ Object
readonly
Returns the value of attribute company_name.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#reader_url ⇒ Object
readonly
Returns the value of attribute reader_url.
-
#report_number ⇒ Object
readonly
Returns the value of attribute report_number.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #dcm_no ⇒ Object
- #ele_id ⇒ Object
-
#initialize(options) ⇒ Report
constructor
A new instance of Report.
- #read(type) ⇒ Object
Constructor Details
#initialize(options) ⇒ Report
Returns a new instance of Report.
10 11 12 13 14 |
# File 'lib/dart_api/report.rb', line 10 def initialize() @company_name, @company_code, @report_number = .values_at("crp_nm", "crp_cd", "rcp_no") @year = ["rcp_dt"][0..3].to_i - 1 # url end |
Instance Attribute Details
#company_code ⇒ Object (readonly)
Returns the value of attribute company_code.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def company_code @company_code end |
#company_name ⇒ Object (readonly)
Returns the value of attribute company_name.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def company_name @company_name end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def content @content end |
#reader_url ⇒ Object (readonly)
Returns the value of attribute reader_url.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def reader_url @reader_url end |
#report_number ⇒ Object (readonly)
Returns the value of attribute report_number.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def report_number @report_number end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def url @url end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
8 9 10 |
# File 'lib/dart_api/report.rb', line 8 def year @year end |
Instance Method Details
#dcm_no ⇒ Object
16 17 18 19 |
# File 'lib/dart_api/report.rb', line 16 def dcm_no generate unless @dcm_no @dcm_no end |
#ele_id ⇒ Object
21 22 23 24 |
# File 'lib/dart_api/report.rb', line 21 def ele_id generate unless @ele_id @ele_id end |
#read(type) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/dart_api/report.rb', line 40 def read(type) result = Hash.new content.search("table").each do |table| read_table table end result end |