Module: PrawnComponents::Components::H3

Defined in:
lib/prawn_components/components/h3.rb

Instance Method Summary collapse

Instance Method Details

#h3(value, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/prawn_components/components/h3.rb', line 4

def h3(value, options = {})
  callback = options.key?(:callback) ? options[:callback] : lambda { |x| x }
  font_size = options.fetch(:font_size, 16)
  font_family = options.fetch(:font_family, 'Helvetica')

  font(font_family) do
    text(callback.call(value), size: font_size, style: :bold, inline_format: true)
  end
  move_down(10)
end