class method self.new

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

self.new(start_transition, end_transition, offset = nil)

Initializes a new TimezonePeriod.

Parameters

start_transition req
end_transition req
offset opt = nil
Source
# File activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_period.rb, line 44
    def initialize(start_transition, end_transition, offset = nil)
      @start_transition = start_transition
      @end_transition = end_transition
      
      if offset
        raise ArgumentError, 'Offset specified with transitions' if @start_transition || @end_transition
        @offset = offset
      else
        if @start_transition 
          @offset = @start_transition.offset
        elsif @end_transition
          @offset = @end_transition.previous_offset
        else
          raise ArgumentError, 'No offset specified and no transitions to determine it from'
        end
      end
      
      @utc_total_offset_rational = nil      
    end

Defined in activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_period.rb line 44 · View on GitHub · Improve this page · Find usages on GitHub

Defined in TZInfo::TimezonePeriod

Type at least 2 characters to search.

↑↓ navigate · open · esc close