Class: Unit::Types::Phone
- Inherits:
-
Object
- Object
- Unit::Types::Phone
- Defined in:
- lib/unit/types/phone.rb
Instance Attribute Summary collapse
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(country_code, number) ⇒ Phone
constructor
A new instance of Phone.
- #represent ⇒ Object
Constructor Details
#initialize(country_code, number) ⇒ Phone
Returns a new instance of Phone.
10 11 12 13 |
# File 'lib/unit/types/phone.rb', line 10 def initialize(country_code, number) @country_code = country_code @number = number end |
Instance Attribute Details
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
6 7 8 |
# File 'lib/unit/types/phone.rb', line 6 def country_code @country_code end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
6 7 8 |
# File 'lib/unit/types/phone.rb', line 6 def number @number end |
Instance Method Details
#represent ⇒ Object
15 16 17 18 19 20 |
# File 'lib/unit/types/phone.rb', line 15 def represent { countryCode: country_code, number: number } end |