Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/phony_rails/string_extensions.rb
Instance Method Summary collapse
-
#phony_formatted(options = {}) ⇒ Object
Add a method to the String class so we can easily format phone numbers.
Instance Method Details
#phony_formatted(options = {}) ⇒ Object
Add a method to the String class so we can easily format phone numbers. This enables:
"31612341234".phony_formatted # => '06 12341234'
"31612341234".phony_formatted(:spaces => '-') # => '06-12341234'
7 8 9 |
# File 'lib/phony_rails/string_extensions.rb', line 7 def phony_formatted( = {}) Phony.formatted(self, .reverse_merge(:format => :national)) end |