class Proforma::PrawnRenderer::Renderer

The base class that contains common functionality across all sub-rendering components.

Attributes

options[R]
pdf[R]

Public Class Methods

new(pdf, options) click to toggle source
# File lib/proforma/prawn_renderer/renderer.rb, line 21
def initialize(pdf, options)
  @options  = options
  @pdf      = pdf
end

Private Instance Methods

bold_font_style() click to toggle source
# File lib/proforma/prawn_renderer/renderer.rb, line 30
def bold_font_style
  options.bold_font_style.to_s.to_sym
end
calculate_width(percentage) click to toggle source
# File lib/proforma/prawn_renderer/renderer.rb, line 38
def calculate_width(percentage)
  return 0 unless percentage

  total_width * (percentage.to_f / 100)
end
total_width() click to toggle source
# File lib/proforma/prawn_renderer/renderer.rb, line 34
def total_width
  pdf.bounds.width
end