Class: Pdf::Components::Context

Inherits:
Pdf::Component show all
Defined in:
lib/pdf/components/context.rb

Instance Attribute Summary

Attributes inherited from Pdf::Component

#pdf

Instance Method Summary collapse

Methods inherited from Pdf::Component

#initialize

Constructor Details

This class inherits a constructor from Pdf::Component

Instance Method Details

#render(lines, label: "CONTEXT", **_options) ⇒ Object

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
13
# File 'lib/pdf/components/context.rb', line 6

def render(lines, label: "CONTEXT", **_options)
  raise ArgumentError, "Context lines cannot be nil" if lines.nil?
  return if lines.empty?

  text label, size: 12, style: :bold
  lines.each { |line| text line.to_s, size: 10 }
  move_down 20
end