Class: Fone::PhoneNumber

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number) ⇒ PhoneNumber

Returns a new instance of PhoneNumber.



8
9
10
11
# File 'lib/fone/phone_number.rb', line 8

def initialize(number)
  phone = Phoner::Phone.parse number.to_s
  @area_code = AreaCode[phone.area_code]
end

Instance Attribute Details

#area_codeObject (readonly)

Returns the value of attribute area_code.



13
14
15
# File 'lib/fone/phone_number.rb', line 13

def area_code
  @area_code
end