Module: PrawnComponents::Components::H4

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

Instance Method Summary collapse

Instance Method Details

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



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

def h4(value, options = {})
  callback = options.key?(:callback) ? options[:callback] : lambda { |x| x }
  font_size = options.fetch(:font_size, 14)
  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