Class: Receipt
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Receipt
- Defined in:
- app/models/receipt.rb
Instance Method Summary collapse
Instance Method Details
#document_title ⇒ Object
17 18 19 |
# File 'app/models/receipt.rb', line 17 def document_title document.blank? ? '' : document.title end |
#print ⇒ Object
11 12 13 14 15 |
# File 'app/models/receipt.rb', line 11 def print data = fields.merge(:id => id, :keyword => Terminal.config.keyword) result = Liquid::Template.parse(template).render data.with_indifferent_access update_attributes(:printed => true) if Smartware.printer.print_text(result, 15) end |