Class: PkiExpress::PadesVisualRectangle

Inherits:
Object
  • Object
show all
Defined in:
lib/pki_express/pades_visual_rectangle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePadesVisualRectangle

Returns a new instance of PadesVisualRectangle.



5
6
7
8
9
10
11
12
# File 'lib/pki_express/pades_visual_rectangle.rb', line 5

def initialize
  @left = nil
  @top = nil
  @right = nil
  @bottom = nil
  @width = nil
  @height = nil
end

Instance Attribute Details

#bottomObject

Returns the value of attribute bottom.



3
4
5
# File 'lib/pki_express/pades_visual_rectangle.rb', line 3

def bottom
  @bottom
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/pki_express/pades_visual_rectangle.rb', line 3

def height
  @height
end

#leftObject

Returns the value of attribute left.



3
4
5
# File 'lib/pki_express/pades_visual_rectangle.rb', line 3

def left
  @left
end

#rightObject

Returns the value of attribute right.



3
4
5
# File 'lib/pki_express/pades_visual_rectangle.rb', line 3

def right
  @right
end

#topObject

Returns the value of attribute top.



3
4
5
# File 'lib/pki_express/pades_visual_rectangle.rb', line 3

def top
  @top
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/pki_express/pades_visual_rectangle.rb', line 3

def width
  @width
end

Instance Method Details

#set_height_bottom_anchored(height, bottom) ⇒ Object



50
51
52
53
54
# File 'lib/pki_express/pades_visual_rectangle.rb', line 50

def set_height_bottom_anchored(height, bottom)
  @height = height
  @top = nil
  @bottom = bottom
end

#set_height_centered(height) ⇒ Object



38
39
40
41
42
# File 'lib/pki_express/pades_visual_rectangle.rb', line 38

def set_height_centered(height)
  @height = height
  @top = nil
  @bottom = nil
end

#set_height_top_anchored(height, top) ⇒ Object



44
45
46
47
48
# File 'lib/pki_express/pades_visual_rectangle.rb', line 44

def set_height_top_anchored(height, top)
  @height = height
  @top = top
  @bottom = nil
end

#set_horizontal_stretch(left, right) ⇒ Object



32
33
34
35
36
# File 'lib/pki_express/pades_visual_rectangle.rb', line 32

def set_horizontal_stretch(left, right)
  @width = nil
  @left = left
  @right = right
end

#set_vertical_stretch(top, bottom) ⇒ Object



56
57
58
59
60
# File 'lib/pki_express/pades_visual_rectangle.rb', line 56

def set_vertical_stretch(top, bottom)
  @height = nil
  @top = top
  @bottom = bottom
end

#set_width_centered(width) ⇒ Object



14
15
16
17
18
# File 'lib/pki_express/pades_visual_rectangle.rb', line 14

def set_width_centered(width)
  @width = width
  @left = nil
  @right = nil
end

#set_width_left_anchored(width, left) ⇒ Object



20
21
22
23
24
# File 'lib/pki_express/pades_visual_rectangle.rb', line 20

def set_width_left_anchored(width, left)
  @width = width
  @left = left
  @right = nil
end

#set_width_right_anchored(width, right) ⇒ Object



26
27
28
29
30
# File 'lib/pki_express/pades_visual_rectangle.rb', line 26

def set_width_right_anchored(width, right)
  @width = width
  @left = nil
  @right = right
end

#to_modelObject



62
63
64
65
66
67
68
69
70
71
# File 'lib/pki_express/pades_visual_rectangle.rb', line 62

def to_model
  {
      left: @left,
      top: @top,
      right: @right,
      bottom: @bottom,
      width: @width,
      height: @height,
  }
end