Class: IrsForms::Form

Inherits:
Object
  • Object
show all
Defined in:
lib/irs_forms/form.rb

Direct Known Subclasses

Form1096, Form1099

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options={})
  self.data = options[:data] || {}
  self.x_offset = options[:x_offset]
  self.y_offset = options[:y_offset]
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/irs_forms/form.rb', line 3

def data
  @data
end

#x_offsetObject

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_offsetObject

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.expand_path(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(options={})
  to_prawn(options).render
end