Class: IrsForms::Form
- Inherits:
-
Object
- Object
- IrsForms::Form
- Defined in:
- lib/irs_forms/form.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#x_offset ⇒ Object
Returns the value of attribute x_offset.
-
#y_offset ⇒ Object
Returns the value of attribute y_offset.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Form
constructor
A new instance of Form.
- #template_filepath(filename) ⇒ Object
- #to_pdf(options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Form
Returns a new instance of Form.
5 6 7 8 9 |
# File 'lib/irs_forms/form.rb', line 5 def initialize(={}) self.data = [:data] || {} self.x_offset = [:x_offset] self.y_offset = [:y_offset] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/irs_forms/form.rb', line 3 def data @data end |
#x_offset ⇒ Object
Returns the value of attribute x_offset.
3 4 5 |
# File 'lib/irs_forms/form.rb', line 3 def x_offset @x_offset end |
#y_offset ⇒ Object
Returns the value of attribute y_offset.
3 4 5 |
# File 'lib/irs_forms/form.rb', line 3 def y_offset @y_offset end |
Instance Method Details
#template_filepath(filename) ⇒ Object
11 12 13 14 |
# File 'lib/irs_forms/form.rb', line 11 def template_filepath(filename) dir = File.(File.dirname(__FILE__) + '/../../templates') "#{dir}/#{filename}" end |
#to_pdf(options = {}) ⇒ Object
16 17 18 |
# File 'lib/irs_forms/form.rb', line 16 def to_pdf(={}) to_prawn().render end |