Class: Fone::PhoneNumber
- Inherits:
-
Object
- Object
- Fone::PhoneNumber
- Defined in:
- lib/fone/phone_number.rb
Instance Attribute Summary collapse
-
#area_code ⇒ Object
readonly
Returns the value of attribute area_code.
Instance Method Summary collapse
-
#initialize(number) ⇒ PhoneNumber
constructor
A new instance of PhoneNumber.
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_code ⇒ Object (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 |