Class: Interage::ParserPhone

Inherits:
Object
  • Object
show all
Includes:
NumberHelper
Defined in:
lib/interage/parsers/parser_phone.rb

Constant Summary collapse

ALLOWED_SIZES =
[13, 11, 9, 8].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from NumberHelper

#default_currency_format, #only_numbers

Constructor Details

#initialize(phone) ⇒ ParserPhone

Returns a new instance of ParserPhone.



13
14
15
# File 'lib/interage/parsers/parser_phone.rb', line 13

def initialize(phone)
  @phone = only_numbers(phone).to_i.to_s
end

Class Method Details

.call(phone) ⇒ Object



9
10
11
# File 'lib/interage/parsers/parser_phone.rb', line 9

def self.call(phone)
  new(phone).perform
end

Instance Method Details

#performObject



17
18
19
# File 'lib/interage/parsers/parser_phone.rb', line 17

def perform
  formatted_phone
end