instance method
minus_with_coercion
Ruby on Rails 3.1.12
Since v3.0.20Signature
minus_with_coercion(other)
Time#- can also be used to determine the number of seconds between two Time instances. We’re layering on additional behavior so that ActiveSupport::TimeWithZone instances are coerced into values that Time#- will recognize
Parameters
-
otherreq
Source
# File activesupport/lib/active_support/core_ext/time/calculations.rb, line 275
def minus_with_coercion(other)
other = other.comparable_time if other.respond_to?(:comparable_time)
other.is_a?(DateTime) ? to_f - other.to_f : minus_without_coercion(other)
end
Defined in activesupport/lib/active_support/core_ext/time/calculations.rb line 275
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Time