Class: AUB::Payroll::SummaryFile::HTMLGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/aub/payroll/summary_file/html_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(company_info:, payroll_info:, transactions:) ⇒ HTMLGenerator

Returns a new instance of HTMLGenerator.



6
7
8
9
10
# File 'lib/aub/payroll/summary_file/html_generator.rb', line 6

def initialize(company_info:, payroll_info:, transactions:)
  @company_info = company_info
  @payroll_info = payroll_info
  @transactions = transactions
end

Instance Attribute Details

#company_infoObject (readonly)

Returns the value of attribute company_info.



27
28
29
# File 'lib/aub/payroll/summary_file/html_generator.rb', line 27

def company_info
  @company_info
end

#payroll_infoObject (readonly)

Returns the value of attribute payroll_info.



27
28
29
# File 'lib/aub/payroll/summary_file/html_generator.rb', line 27

def payroll_info
  @payroll_info
end

#transactionsObject (readonly)

Returns the value of attribute transactions.



27
28
29
# File 'lib/aub/payroll/summary_file/html_generator.rb', line 27

def transactions
  @transactions
end

Instance Method Details

#generateObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/aub/payroll/summary_file/html_generator.rb', line 12

def generate
  Dir.mktmpdir do |dir|
    Dir.chdir(dir) do
      render 'body.slim', 'body.html'
      render 'header.slim', 'header.html'
      render 'footer.slim', 'footer.html'
      render 'style.scss', 'style.css'
      render 'clear.css', with: :copy
      render 'footer.js', with: :copy
      render 'underscore-min.js', with: :copy, from: :vendor
      yield
    end
  end
end