Module: PdfFill::Forms::FormHelper::PhoneNumberFormatting

Defined in:
lib/pdf_fill/forms/form_helper.rb

Overview

Further readability improvements require various refactoring and code de-duplication across different forms.

Instance Method Summary collapse

Instance Method Details

#expand_phone_number(phone_number) ⇒ Object

[View source] [View on GitHub]

133
134
135
136
137
138
139
140
# File 'lib/pdf_fill/forms/form_helper.rb', line 133

def expand_phone_number(phone_number)
  phone_number = phone_number.delete('^0-9')
  {
    'phone_area_code' => phone_number[0..2],
    'phone_first_three_numbers' => phone_number[3..5],
    'phone_last_four_numbers' => phone_number[6..9]
  }
end