Module: Prawn::Markup::Processor::Inputs

Included in:
Prawn::Markup::Processor
Defined in:
lib/prawn/markup/processor/inputs.rb

Constant Summary collapse

DEFAULT_CHECKABLE_CHARS =
{
  checkbox: {
    checked: '☑',
    unchecked: '☐'
  },
  radio: {
    checked: '◉',
    unchecked: '○'
  }
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



18
19
20
# File 'lib/prawn/markup/processor/inputs.rb', line 18

def self.prepended(base)
  base.known_elements.push('input')
end

Instance Method Details

#start_inputObject



22
23
24
25
26
27
# File 'lib/prawn/markup/processor/inputs.rb', line 22

def start_input
  type = current_attrs['type'].to_sym
  if DEFAULT_CHECKABLE_CHARS.keys.include?(type)
    append_checked_symbol(type)
  end
end