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
15 16 17 |
# File 'app/models/receipt.rb', line 15 def document_title document.blank? ? '' : document.title end |
#print ⇒ Object
9 10 11 12 13 |
# File 'app/models/receipt.rb', line 9 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 |