class RestPki::PdfMarkTextElement

Attributes

align[RW]
text_sections[RW]

Public Class Methods

new(relative_container=nil, text_sections=[]) click to toggle source
Calls superclass method RestPki::PdfMarkElement::new
# File lib/rest_pki/pdf_mark_text_element.rb, line 5
def initialize(relative_container=nil, text_sections=[])
  super(PdfMarkElementType::TEXT, relative_container)
  @text_sections = text_sections
  @align = 'Left'
end

Public Instance Methods

add_section(section) click to toggle source
# File lib/rest_pki/pdf_mark_text_element.rb, line 35
def add_section(section)
  @text_sections.push(section)
  self
end
add_section_with_text(text) click to toggle source
# File lib/rest_pki/pdf_mark_text_element.rb, line 40
def add_section_with_text(text)
  @text_sections.push(PdfTextSection.new(text))
  self
end
align_text_center() click to toggle source
# File lib/rest_pki/pdf_mark_text_element.rb, line 30
def align_text_center
  @align = 'Center'
  self
end
align_text_left() click to toggle source

region FluentApi

# File lib/rest_pki/pdf_mark_text_element.rb, line 20
def align_text_left
  @align = 'Left'
  self
end
align_text_right() click to toggle source
# File lib/rest_pki/pdf_mark_text_element.rb, line 25
def align_text_right
  @align = 'Right'
  self
end
to_model() click to toggle source
Calls superclass method RestPki::PdfMarkElement#to_model
# File lib/rest_pki/pdf_mark_text_element.rb, line 11
def to_model
  model = super
  model['textSections'] = @text_sections.map { |s| s.to_model }
  model['align'] = @align
  model
end