Class: DynamicPDFApi::FormField
- Inherits:
-
Object
- Object
- DynamicPDFApi::FormField
- Defined in:
- lib/ruby_client/FormField.rb
Overview
Represents a form field in the PDF document.
Instance Attribute Summary collapse
-
#flatten ⇒ Object
Gets or sets a boolean indicating whether to flatten the form field.
-
#name ⇒ Object
Gets or sets name of the form field.
-
#remove ⇒ Object
Gets or sets a boolean indicating whether to remove the form field.
-
#value ⇒ Object
Gets or sets value of the form field.
Instance Method Summary collapse
-
#initialize(name, value = nil) ⇒ FormField
constructor
Initializes a new instance of the FormField class using the name and the value of the form field as parameters.
- #to_json(_options = {}) ⇒ Object
Constructor Details
#initialize(name, value = nil) ⇒ FormField
Initializes a new instance of the FormField class using the name and the value of the form field as parameters.
14 15 16 17 18 19 20 |
# File 'lib/ruby_client/FormField.rb', line 14 def initialize(name, value = nil) @flatten = nil @remove = nil @name = name @value = value end |
Instance Attribute Details
#flatten ⇒ Object
Gets or sets a boolean indicating whether to flatten the form field.
35 36 37 |
# File 'lib/ruby_client/FormField.rb', line 35 def flatten @flatten end |
#name ⇒ Object
Gets or sets name of the form field.
25 26 27 |
# File 'lib/ruby_client/FormField.rb', line 25 def name @name end |
#remove ⇒ Object
Gets or sets a boolean indicating whether to remove the form field.
40 41 42 |
# File 'lib/ruby_client/FormField.rb', line 40 def remove @remove end |
#value ⇒ Object
Gets or sets value of the form field.
30 31 32 |
# File 'lib/ruby_client/FormField.rb', line 30 def value @value end |
Instance Method Details
#to_json(_options = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ruby_client/FormField.rb', line 42 def to_json( = {}) json_array = {} json_array['name'] = @name json_array['value'] = @value unless @value.nil? json_array['flatten'] = @flatten unless @flatten.nil? json_array['remove'] = @remove unless @remove.nil? JSON.pretty_generate(json_array) end |