Sha256: 732a3babd7bb1d252bdbae8173c355b557e7ccb8567a53c33bd4eb21f005f34b

Contents?: true

Size: 371 Bytes

Versions: 8

Compression:

Stored size: 371 Bytes

Contents

  class String

    # 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'
    def phony_formatted(options = {})
      options[:format] ||= :national
      Phony.formatted(self, options)
    end

  end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
phony_rails-0.0.9 lib/phony_rails/string_extensions.rb
phony_rails-0.0.8 lib/phony_rails/string_extensions.rb
phony_rails-0.0.7 lib/phony_rails/string_extensions.rb
phony_rails-0.0.6 lib/phony_rails/string_extensions.rb
phony_rails-0.0.5 lib/phony_rails/string_extensions.rb
phony_rails-0.0.4 lib/phony_rails/string_extensions.rb
phony_number-0.0.2 lib/phony_number/string_extensions.rb
phony_number-0.0.1 lib/phony_number/string_extensions.rb