Class: GnuCash::Invoice::Printer
- Inherits:
-
Object
- Object
- GnuCash::Invoice::Printer
- Defined in:
- lib/gnucash/invoice/printer.rb
Instance Method Summary collapse
- #embedded_asset(pathname) ⇒ Object
- #environment ⇒ Object
-
#initialize(invoice_id) ⇒ Printer
constructor
A new instance of Printer.
- #render ⇒ Object
Constructor Details
Instance Method Details
#embedded_asset(pathname) ⇒ Object
14 15 16 |
# File 'lib/gnucash/invoice/printer.rb', line 14 def pathname environment[pathname].to_s end |
#environment ⇒ Object
19 20 21 22 23 24 |
# File 'lib/gnucash/invoice/printer.rb', line 19 def environment @environment ||= Sprockets::Environment.new(template_dir).tap do |env| env.append_path 'assets/stylesheets' env.css_compressor = :sass end end |
#render ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/gnucash/invoice/printer.rb', line 27 def render template = Slim::Template.new template_dir('invoice.slim').to_s template.render(self, { :invoice => @invoice, :entries => @invoice.entries, :customer => @invoice.customer, :options => Options }) end |