Method: ActiveSupport::TimeWithZone#initialize

Defined in:
lib/active_support/time_with_zone.rb

#initialize(utc_time, time_zone, local_time = nil, period = nil) ⇒ TimeWithZone

Returns a new instance of TimeWithZone.



61
62
63
64
65
# File 'lib/active_support/time_with_zone.rb', line 61

def initialize(utc_time, time_zone, local_time = nil, period = nil)
  @utc = utc_time ? transfer_time_values_to_utc_constructor(utc_time) : nil
  @time_zone, @time = time_zone, local_time
  @period = @utc ? period : get_period_and_ensure_valid_local_time(period)
end