instance method to_formatted_s

Ruby on Rails 4.2.9

Since v3.0.20 Last seen in v4.2.9

Available in: v3.0.20 v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9

Signature

to_formatted_s(format = :default)

Gives a human readable format of the range.

(1..100).to_formatted_s # => "1..100"

Parameters

format opt = :default
Source
# File activesupport/lib/active_support/core_ext/range/conversions.rb, line 9
  def to_formatted_s(format = :default)
    if formatter = RANGE_FORMATS[format]
      formatter.call(first, last)
    else
      to_default_s
    end
  end

Defined in activesupport/lib/active_support/core_ext/range/conversions.rb line 9 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Range

Type at least 2 characters to search.

↑↓ navigate · open · esc close