Class: RockBooks::JournalReport

Inherits:
Object
  • Object
show all
Includes:
ErbHelper, TextReportHelper
Defined in:
lib/rock_books/reports/journal_report.rb

Constant Summary

Constants included from TextReportHelper

TextReportHelper::SHORT_NAME_FORMAT_STRING, TextReportHelper::SHORT_NAME_MAX_LENGTH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ErbHelper

erb_template, render_binding, render_hashes

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_data, report_context, filter = nil) ⇒ JournalReport

Returns a new instance of JournalReport.



15
16
17
18
# File 'lib/rock_books/reports/journal_report.rb', line 15

def initialize(report_data, report_context, filter = nil)
  @report_data = report_data
  @context = report_context
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



12
13
14
# File 'lib/rock_books/reports/journal_report.rb', line 12

def context
  @context
end

#report_dataObject

Returns the value of attribute report_data.



12
13
14
# File 'lib/rock_books/reports/journal_report.rb', line 12

def report_data
  @report_data
end

Instance Method Details

#generateObject



21
22
23
24
# File 'lib/rock_books/reports/journal_report.rb', line 21

def generate
  presentation_context = template_presentation_context.merge(fn_format_entry: method(:format_entry))
  ErbHelper.render_hashes('text/journal.txt.erb', report_data, presentation_context)
end