Methods

Class/Module Index [+]

Quicksearch

ActiveSupport::CoreExtensions::Range::Conversions

Getting ranges in different convenient string representations and other objects

Constants

RANGE_FORMATS

Public Instance Methods

to_formatted_s(format = :default) click to toggle source

Gives a human readable format of the range.

Example

[1..100].to_formatted_s # => "1..100"
# File lib/active_support/core_ext/range/conversions.rb, line 21
def to_formatted_s(format = :default)
  RANGE_FORMATS[format] ? RANGE_FORMATS[format].call(first, last) : to_default_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.