class TZInfo::VirtualTimezone
Public Class Methods
new(seconds_from_gmt)
click to toggle source
Calls superclass method
# File lib/tzinfo/virtual_timezone.rb, line 3 def self.new(seconds_from_gmt) vt = super() vt.send(:setup, seconds_from_gmt) vt end
Public Instance Methods
identifier()
click to toggle source
# File lib/tzinfo/virtual_timezone.rb, line 23 def identifier "secondsFromGMT##{@seconds_from_gmt}" end
period_for(_time)
click to toggle source
# File lib/tzinfo/virtual_timezone.rb, line 9 def period_for(_time) OffsetTimezonePeriod.new(@offset) end
period_for_utc(_utc)
click to toggle source
Returns the TimezonePeriod based on the given seconds from GMT.
# File lib/tzinfo/virtual_timezone.rb, line 14 def period_for_utc(_utc) OffsetTimezonePeriod.new(@offset) end
periods_for_local(_local)
click to toggle source
Returns the array of TimezonePeriod based on the given seconds from GMT.
# File lib/tzinfo/virtual_timezone.rb, line 19 def periods_for_local(_local) [OffsetTimezonePeriod.new(@offset)] end
Private Instance Methods
setup(seconds_from_gmt)
click to toggle source
# File lib/tzinfo/virtual_timezone.rb, line 29 def setup(seconds_from_gmt) @seconds_from_gmt = seconds_from_gmt @offset = TimezoneOffset.new(@seconds_from_gmt, 0, 'VirtualTimeZone') end