Class: PkiExpress::PadesVisualRepresentation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text = nil, image = nil, position = nil) ⇒ PadesVisualRepresentation

Returns a new instance of PadesVisualRepresentation.



5
6
7
8
9
# File 'lib/pki_express/pades_visual_representation.rb', line 5

def initialize(text=nil, image=nil, position=nil)
  @text = text
  @image = image
  @position = position
end

Instance Attribute Details

#imageObject

Returns the value of attribute image.



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

def image
  @image
end

#positionObject

Returns the value of attribute position.



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

def position
  @position
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_modelObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/pki_express/pades_visual_representation.rb', line 11

def to_model
  unless @position
    raise new 'The visual representation position was not set'
  end
  {
      position: @position&.to_model,
      text: @text&.to_model,
      image: @image&.to_model,
  }
end