Class: IrsForms::Form1099
Overview
Base class for Form1099s
Direct Known Subclasses
Constant Summary collapse
- COPIES =
%W{A B C 1 2}
Instance Attribute Summary collapse
-
#copy ⇒ Object
Returns the value of attribute copy.
Attributes inherited from Form
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Form1099
constructor
A new instance of Form1099.
- #to_prawn(options = {}) ⇒ Object
Methods inherited from Form
Constructor Details
#initialize(options = {}) ⇒ Form1099
Returns a new instance of Form1099.
8 9 10 11 12 13 14 |
# File 'lib/irs_forms/form1099.rb', line 8 def initialize(={}) [:data] ||= [] super self.copy = [:copy] check_valid_copy! if copy.present? end |
Instance Attribute Details
#copy ⇒ Object
Returns the value of attribute copy.
4 5 6 |
# File 'lib/irs_forms/form1099.rb', line 4 def copy @copy end |
Instance Method Details
#to_prawn(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/irs_forms/form1099.rb', line 16 def to_prawn(={}) .reverse_merge!(with_template: false) = {:bottom_margin => 0.0} .merge!(:template => template_filepath) if [:with_template] @pdf = Prawn::Document.new() data.each_with_index do |hash, index| position = calculate_position(index) @pdf.start_new_page() if index > 0 and position == :top render_data_to_prawn(hash, position) end @pdf end |