Class: RockBooks::IndexHtmlPage
- Inherits:
-
Object
- Object
- RockBooks::IndexHtmlPage
- Includes:
- TextReportHelper
- Defined in:
- lib/rock_books/reports/index_html_page.rb
Constant Summary
Constants included from TextReportHelper
TextReportHelper::SHORT_NAME_FORMAT_STRING, TextReportHelper::SHORT_NAME_MAX_LENGTH
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(report_context, metadata, run_options) ⇒ IndexHtmlPage
constructor
A new instance of IndexHtmlPage.
Methods included from TextReportHelper
#account_code_format, #account_code_name_type_string, #account_code_name_type_string_for_code, #acct_name, #banner_line, #center, #end_date, #format_acct_amount, #format_multidoc_entry, #generation_info_display_string, #line_item_format_string, #max_account_code_length, #page_width, #section_heading, #start_date, #template_presentation_context, #total_with_ok_or_discrepancy
Constructor Details
#initialize(report_context, metadata, run_options) ⇒ IndexHtmlPage
Returns a new instance of IndexHtmlPage.
11 12 13 14 15 16 17 18 19 |
# File 'lib/rock_books/reports/index_html_page.rb', line 11 def initialize(report_context, , ) @context = report_context @data = { metadata: , journals: context.journals, chart_of_accounts: context.chart_of_accounts, run_options: , } end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
9 10 11 |
# File 'lib/rock_books/reports/index_html_page.rb', line 9 def context @context end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/rock_books/reports/index_html_page.rb', line 9 def data @data end |
Instance Method Details
#generate ⇒ Object
21 22 23 24 25 |
# File 'lib/rock_books/reports/index_html_page.rb', line 21 def generate = template_presentation_context[:generated].split("\n") presentation_context = template_presentation_context.merge( { generated: }) ErbHelper.render_hashes('html/index.html.erb', data, presentation_context) end |