Sha256: 1539c2f51440c617892953aae542887654b21ffe1e03b17de065253570175b40

Contents?: true

Size: 370 Bytes

Versions: 16

Compression:

Stored size: 370 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 = {})
      Phony.formatted(self, options.reverse_merge(:format => :national))
    end

  end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
phony_rails-0.1.12 lib/phony_rails/string_extensions.rb
phony_rails-0.1.11 lib/phony_rails/string_extensions.rb
phony_rails-0.1.10 lib/phony_rails/string_extensions.rb
phony_rails-0.1.9 lib/phony_rails/string_extensions.rb
phony_rails-0.1.8 lib/phony_rails/string_extensions.rb
phony_rails-0.1.7 lib/phony_rails/string_extensions.rb
phony_rails-0.1.6 lib/phony_rails/string_extensions.rb
phony_rails-0.1.5 lib/phony_rails/string_extensions.rb
phony_rails-0.1.4 lib/phony_rails/string_extensions.rb
phony_rails-0.1.3 lib/phony_rails/string_extensions.rb
phony_rails-0.1.2 lib/phony_rails/string_extensions.rb
phony_rails-0.1.1 lib/phony_rails/string_extensions.rb
phony_rails-0.1.0 lib/phony_rails/string_extensions.rb
phony_rails-0.0.12 lib/phony_rails/string_extensions.rb
phony_rails-0.0.11 lib/phony_rails/string_extensions.rb
phony_rails-0.0.10 lib/phony_rails/string_extensions.rb