class ActiveSupport::TimeZone
def [](arg)
Experimental RBS support (using type sampling data from the type_fusion
project).
def []: (ActiveSupport::TimeZone arg) -> untyped
This signature was generated using 1 sample from 1 application.
timezone to find. (The first one with that offset will be returned.)
numeric value it is either the hour offset, or the second offset, of the
is interpreted to mean the name of the timezone to locate. If it is a
Locate a specific time zone object. If the argument is a string, it
def [](arg) case arg when self arg when String begin @lazy_zones_map[arg] ||= create(arg) rescue TZInfo::InvalidTimezoneIdentifier nil end when TZInfo::Timezone @lazy_zones_map[arg.name] ||= create(arg.name, nil, arg) when Numeric, ActiveSupport::Duration arg *= 3600 if arg.abs <= 13 all.find { |z| z.utc_offset == arg.to_i } else raise ArgumentError, "invalid argument to TimeZone[]: #{arg.inspect}" end end