Class: Prawn::Fillform::Field

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

Direct Known Subclasses

Button, Text

Instance Method Summary collapse

Constructor Details

#initialize(dictionary) ⇒ Field

Returns a new instance of Field.



15
16
17
# File 'lib/prawn-fillform.rb', line 15

def initialize(dictionary)
  @dictionary = dictionary
end

Instance Method Details

#default_valueObject



51
52
53
# File 'lib/prawn-fillform.rb', line 51

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

#descriptionObject



19
20
21
# File 'lib/prawn-fillform.rb', line 19

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

#flagsObject



55
56
57
# File 'lib/prawn-fillform.rb', line 55

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

#heightObject



43
44
45
# File 'lib/prawn-fillform.rb', line 43

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

#nameObject



27
28
29
# File 'lib/prawn-fillform.rb', line 27

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

#rectObject



23
24
25
# File 'lib/prawn-fillform.rb', line 23

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

#valueObject



47
48
49
# File 'lib/prawn-fillform.rb', line 47

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

#widthObject



39
40
41
# File 'lib/prawn-fillform.rb', line 39

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

#xObject



31
32
33
# File 'lib/prawn-fillform.rb', line 31

def x
  rect[0]
end

#yObject



35
36
37
# File 'lib/prawn-fillform.rb', line 35

def y
  rect[3]
end