inspect() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/duration.rb, line 72
    def inspect #:nodoc:
      consolidated = parts.inject( { |h,(l,r)| h[l] += r; h }
      parts = [:years, :months, :days, :minutes, :seconds].map do |length|
        n = consolidated[length]
        "#{n} #{n == 1 ? length.to_s.singularize : length.to_s}" if n.nonzero?
      parts = ["0 seconds"] if parts.empty?
      parts.to_sentence(:locale => :en)
Register or log in to add new notes.