Module: PdfTempura::Document::DefaultCommands
Class Method Summary collapse
Instance Method Summary collapse
- #boxed_characters(name, coordinates, height, options = {}, &block) ⇒ Object
- #checkbox_field(name, coordinates, dimensions, options = {}) ⇒ Object
- #field_set(name, options = {}, &block) ⇒ Object
- #table(name, coordinates, options = {}, &block) ⇒ Object
- #text_field(name, coordinates, dimensions, options = {}) ⇒ Object
- #with_default_options(options = {}, &block) ⇒ Object
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 4 def self.included(base) base.send(:attr_accessor, :fields) end |
Instance Method Details
#boxed_characters(name, coordinates, height, options = {}, &block) ⇒ Object
20 21 22 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 20 def boxed_characters(name, coordinates, height, = {}, &block) fields << Document::BoxedCharacters.new(name, coordinates, height, @options.merge(), &block) end |
#checkbox_field(name, coordinates, dimensions, options = {}) ⇒ Object
12 13 14 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 12 def checkbox_field(name, coordinates, dimensions, = {}) fields << Document::CheckboxField.new(name, coordinates, dimensions, @options.merge()) end |
#field_set(name, options = {}, &block) ⇒ Object
24 25 26 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 24 def field_set(name, = {}, &block) fields << Document::FieldSet.new(name, @options.merge(), &block) end |
#table(name, coordinates, options = {}, &block) ⇒ Object
16 17 18 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 16 def table(name, coordinates, = {}, &block) fields << Document::Table.new(name, coordinates, @options.merge(), &block) end |
#text_field(name, coordinates, dimensions, options = {}) ⇒ Object
8 9 10 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 8 def text_field(name, coordinates, dimensions, = {}) fields << Document::TextField.new(name, coordinates, dimensions, @options.merge()) end |
#with_default_options(options = {}, &block) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/pdf_tempura/document/default_commands.rb', line 28 def ( = {}, &block) = @options begin @options = @options.merge() instance_eval(&block) ensure @options = end end |