Class: Invoicer
- Inherits:
-
Prawn::Document
- Object
- Prawn::Document
- Invoicer
- Defined in:
- lib/invoicer.rb
Instance Attribute Summary collapse
-
#company ⇒ Object
Returns the value of attribute company.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#entries ⇒ Object
Returns the value of attribute entries.
-
#foot ⇒ Object
Returns the value of attribute foot.
-
#notes ⇒ Object
Returns the value of attribute notes.
Instance Method Summary collapse
- #draw_invoice ⇒ Object
-
#initialize(options = {}) ⇒ Invoicer
constructor
A new instance of Invoicer.
Constructor Details
#initialize(options = {}) ⇒ Invoicer
Returns a new instance of Invoicer.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/invoicer.rb', line 7 def initialize(={}) # Array of hashes: # @entries << {:description => '', :rate => 0, :number => 0} @entries = .delete(:entries) || [] @company = .delete(:company) @customer = .delete(:customer) @notes = .delete(:notes) @foot = .delete(:footer) @number = .delete(:number) super end |
Instance Attribute Details
#company ⇒ Object
Returns the value of attribute company.
5 6 7 |
# File 'lib/invoicer.rb', line 5 def company @company end |
#customer ⇒ Object
Returns the value of attribute customer.
5 6 7 |
# File 'lib/invoicer.rb', line 5 def customer @customer end |
#entries ⇒ Object
Returns the value of attribute entries.
5 6 7 |
# File 'lib/invoicer.rb', line 5 def entries @entries end |
#foot ⇒ Object
Returns the value of attribute foot.
5 6 7 |
# File 'lib/invoicer.rb', line 5 def foot @foot end |
#notes ⇒ Object
Returns the value of attribute notes.
5 6 7 |
# File 'lib/invoicer.rb', line 5 def notes @notes end |
Instance Method Details
#draw_invoice ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/invoicer.rb', line 20 def draw_invoice draw_header draw_addresses draw_entries draw_vat_and_total draw_notes draw_foot end |