Class: TZInfo::VirtualTimezone
- Inherits:
-
Timezone
- Object
- Timezone
- TZInfo::VirtualTimezone
- Defined in:
- lib/tzinfo/virtual_timezone.rb
Class Method Summary collapse
Instance Method Summary collapse
- #identifier ⇒ Object
- #period_for(_time) ⇒ Object
-
#period_for_utc(_utc) ⇒ Object
Returns the TimezonePeriod based on the given seconds from GMT.
-
#periods_for_local(_local) ⇒ Object
Returns the array of TimezonePeriod based on the given seconds from GMT.
Class Method Details
.new(seconds_from_gmt) ⇒ Object
3 4 5 6 7 |
# File 'lib/tzinfo/virtual_timezone.rb', line 3 def self.new(seconds_from_gmt) vt = super() vt.send(:setup, seconds_from_gmt) vt end |
Instance Method Details
#identifier ⇒ Object
23 24 25 |
# File 'lib/tzinfo/virtual_timezone.rb', line 23 def identifier "secondsFromGMT##{@seconds_from_gmt}" end |
#period_for(_time) ⇒ Object
9 10 11 |
# File 'lib/tzinfo/virtual_timezone.rb', line 9 def period_for(_time) OffsetTimezonePeriod.new(@offset) end |
#period_for_utc(_utc) ⇒ Object
Returns the TimezonePeriod based on the given seconds from GMT.
14 15 16 |
# File 'lib/tzinfo/virtual_timezone.rb', line 14 def period_for_utc(_utc) OffsetTimezonePeriod.new(@offset) end |
#periods_for_local(_local) ⇒ Object
Returns the array of TimezonePeriod based on the given seconds from GMT.
19 20 21 |
# File 'lib/tzinfo/virtual_timezone.rb', line 19 def periods_for_local(_local) [OffsetTimezonePeriod.new(@offset)] end |