Class: PrawnRailsForms::FieldRow
- Inherits:
-
Object
- Object
- PrawnRailsForms::FieldRow
- Defined in:
- lib/prawn-rails-forms/field_row.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#height ⇒ Object
Returns the value of attribute height.
-
#unit_width ⇒ Object
Returns the value of attribute unit_width.
-
#units ⇒ Object
Returns the value of attribute units.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #at_height(height, options = {}) ⇒ Object
- #check_box_field(**args) ⇒ Object
-
#initialize(document, height, units, x, y, unit_width) ⇒ FieldRow
constructor
A new instance of FieldRow.
- #text_field(**args) ⇒ Object
Constructor Details
#initialize(document, height, units, x, y, unit_width) ⇒ FieldRow
Returns a new instance of FieldRow.
7 8 9 10 |
# File 'lib/prawn-rails-forms/field_row.rb', line 7 def initialize(document, height, units, x, y, unit_width) @document, @height, @units, @x, @y, @unit_width = document, height, units, x, y, unit_width end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
5 6 7 |
# File 'lib/prawn-rails-forms/field_row.rb', line 5 def document @document end |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'lib/prawn-rails-forms/field_row.rb', line 5 def height @height end |
#unit_width ⇒ Object
Returns the value of attribute unit_width.
5 6 7 |
# File 'lib/prawn-rails-forms/field_row.rb', line 5 def unit_width @unit_width end |
#units ⇒ Object
Returns the value of attribute units.
5 6 7 |
# File 'lib/prawn-rails-forms/field_row.rb', line 5 def units @units end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/prawn-rails-forms/field_row.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/prawn-rails-forms/field_row.rb', line 5 def y @y end |
Instance Method Details
#at_height(height, options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/prawn-rails-forms/field_row.rb', line 12 def at_height(height, = {}) @y -= height @x = [:unit] * @unit_width if [:unit].present? yield @y += height end |
#check_box_field(**args) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/prawn-rails-forms/field_row.rb', line 26 def check_box_field(**args) start, width, height = field_attributes args @document.send :make_check_box_field, start, width, height, **args.except(:width, :height) @x += width end |
#text_field(**args) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/prawn-rails-forms/field_row.rb', line 19 def text_field(**args) start, width, height = field_attributes args @document.send :make_text_field, start, width, height, **args.except(:width, :height) @x += width end |