Class: Dscf::Marketplace::InvoicePdfGenerator
- Inherits:
-
Object
- Object
- Dscf::Marketplace::InvoicePdfGenerator
- Defined in:
- app/services/dscf/marketplace/invoice_pdf_generator.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#order_invoice ⇒ Object
readonly
Returns the value of attribute order_invoice.
Instance Method Summary collapse
- #generate! ⇒ Object
-
#initialize(order) ⇒ InvoicePdfGenerator
constructor
A new instance of InvoicePdfGenerator.
Constructor Details
#initialize(order) ⇒ InvoicePdfGenerator
Returns a new instance of InvoicePdfGenerator.
6 7 8 9 10 |
# File 'app/services/dscf/marketplace/invoice_pdf_generator.rb', line 6 def initialize(order) @order = order @business = order.ordered_to @customer = order.ordered_by end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/services/dscf/marketplace/invoice_pdf_generator.rb', line 4 def order @order end |
#order_invoice ⇒ Object (readonly)
Returns the value of attribute order_invoice.
4 5 6 |
# File 'app/services/dscf/marketplace/invoice_pdf_generator.rb', line 4 def order_invoice @order_invoice end |
Instance Method Details
#generate! ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/services/dscf/marketplace/invoice_pdf_generator.rb', line 12 def generate! @order_invoice = build_invoice ActiveRecord::Base.transaction do @order_invoice.save! generate_and_attach_pdf end @order_invoice end |