Class: Faker::PhoneNumber

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/phone_number.rb

Constant Summary

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary (collapse)

Methods inherited from Base

bothify, fetch, flexible, letterify, method_missing, numerify, parse, regexify, translate

Class Method Details

+ (Object) cell_phone



8
9
10
11
12
13
14
# File 'lib/faker/phone_number.rb', line 8

def cell_phone
  if (translation = translate(:faker)[:cell_phone]).is_a? Hash
    numerify(translation[:formats].sample)
  else
    numerify(fetch('phone_number.formats'))
  end
end

+ (Object) phone_number



4
5
6
# File 'lib/faker/phone_number.rb', line 4

def phone_number
  numerify(fetch('phone_number.formats'))
end