Class: PdfForms::Pdf
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#field(name) ⇒ Object
the field object for the named field.
-
#fields ⇒ Object
list of field objects for all defined fields.
-
#initialize(path, pdftk) ⇒ Pdf
constructor
A new instance of Pdf.
Methods included from SafePath
#file_path, #normalize_path, #quote_path
Constructor Details
#initialize(path, pdftk) ⇒ Pdf
Returns a new instance of Pdf.
12 13 14 15 16 |
# File 'lib/pdf_forms/pdf.rb', line 12 def initialize(path, pdftk) @path = file_path(path) raise IOError unless File.readable?(@path) @pdftk = pdftk end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/pdf_forms/pdf.rb', line 10 def path @path end |
Instance Method Details
#field(name) ⇒ Object
the field object for the named field
24 25 26 |
# File 'lib/pdf_forms/pdf.rb', line 24 def field(name) fields.detect{ |f| f.name == name } end |
#fields ⇒ Object
list of field objects for all defined fields
19 20 21 |
# File 'lib/pdf_forms/pdf.rb', line 19 def fields @fields ||= read_fields end |