Class: PDFRavager::Fields::Checkbox
Instance Attribute Summary collapse
Instance Method Summary
collapse
#set_xfa_value, #xfa_name
#acro_form_name, #set_acro_form_value
Constructor Details
#initialize(name, value, opts = {}) ⇒ Checkbox
12
13
14
15
16
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 12
def initialize(name, value, opts={})
@name, @value = name, value
@true_value = opts[:true_value] ? opts[:true_value] : '1'
@false_value = opts[:false_value] ? opts[:false_value] : '0'
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
10
11
12
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 10
def name
@name
end
|
#value ⇒ Object
Returns the value of attribute value.
10
11
12
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 10
def value
@value
end
|
Instance Method Details
#==(other) ⇒ Object
18
19
20
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 18
def ==(other)
self.name == other.name && self.value == other.value
end
|
30
31
32
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 30
def acro_form_value
@value ? @true_value : @false_value
end
|
#xfa_node_type ⇒ Object
22
23
24
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 22
def xfa_node_type
'integer'
end
|
#xfa_value ⇒ Object
26
27
28
|
# File 'lib/pdf_ravager/fields/checkbox.rb', line 26
def xfa_value
@value ? @true_value : @false_value
end
|