instance method
get_period_and_ensure_valid_local_time
Ruby on Rails 2.2.3
Since v2.2.3 PrivateSignature
get_period_and_ensure_valid_local_time()
No documentation comment.
Source
# File activesupport/lib/active_support/time_with_zone.rb, line 311
def get_period_and_ensure_valid_local_time
# we don't want a Time.local instance enforcing its own DST rules as well,
# so transfer time values to a utc constructor if necessary
@time = transfer_time_values_to_utc_constructor(@time) unless @time.utc?
begin
@time_zone.period_for_local(@time)
rescue ::TZInfo::PeriodNotFound
# time is in the "spring forward" hour gap, so we're moving the time forward one hour and trying again
@time += 1.hour
retry
end
end
Defined in activesupport/lib/active_support/time_with_zone.rb line 311
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TimeWithZone