Class: Ruby::Fillform::Field

Inherits:
Object
  • Object
show all
Includes:
Prawn::Document::Internals
Defined in:
lib/ruby-fillform.rb

Direct Known Subclasses

Button, Checkbox, Text

Instance Method Summary collapse

Constructor Details

#initialize(dictionary) ⇒ Field



16
17
18
# File 'lib/ruby-fillform.rb', line 16

def initialize(dictionary)
  @dictionary = dictionary
end

Instance Method Details

#default_valueObject



52
53
54
# File 'lib/ruby-fillform.rb', line 52

def default_value
  deref(@dictionary[:DV])
end

#descriptionObject



20
21
22
# File 'lib/ruby-fillform.rb', line 20

def description
  deref(@dictionary[:TU])
end

#flagsObject



56
57
58
# File 'lib/ruby-fillform.rb', line 56

def flags
  deref(@dictionary[:Ff])
end

#heightObject



44
45
46
# File 'lib/ruby-fillform.rb', line 44

def height
  rect[3] - rect[1]
end

#nameObject



28
29
30
# File 'lib/ruby-fillform.rb', line 28

def name
  deref(@dictionary[:T]).to_sym
end

#rectObject



24
25
26
# File 'lib/ruby-fillform.rb', line 24

def rect
  deref(@dictionary[:Rect])
end

#valueObject



48
49
50
# File 'lib/ruby-fillform.rb', line 48

def value
  deref(@dictionary[:V])
end

#widthObject



40
41
42
# File 'lib/ruby-fillform.rb', line 40

def width
  rect[2] - rect[0]
end

#xObject



32
33
34
# File 'lib/ruby-fillform.rb', line 32

def x
  rect[0]
end

#yObject



36
37
38
# File 'lib/ruby-fillform.rb', line 36

def y
  rect[3]
end