Method: RussianPhone::Number#format

Defined in:
lib/russian_phone/number.rb

#formatObject



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/russian_phone/number.rb', line 85

def format
  if subscriber.length == 7
    split([3, 2, 2], subscriber)
  elsif subscriber.length == 6
    split([2, 2, 2], subscriber)
  elsif subscriber.length == 5
    split([1, 2, 2], subscriber)
  else
    []
  end
end