class Time

def find_zone!(time_zone)

Experimental RBS support (using type sampling data from the type_fusion project).

def find_zone!: (ActiveSupport::TimeZone time_zone) -> ActiveSupport::TimeZone

This signature was generated using 5 samples from 1 application.

Time.find_zone! "NOT-A-TIMEZONE" # => ArgumentError: Invalid Timezone: NOT-A-TIMEZONE
Time.find_zone! false # => false
Time.find_zone! nil # => nil
Time.find_zone! -5.hours # => #
Time.find_zone! "EST" # => #
Time.find_zone! "America/New_York" # => #

Raises an +ArgumentError+ for invalid time zones.
Accepts the time zone in any format supported by Time.zone=.
Returns a TimeZone instance matching the time zone provided.
def find_zone!(time_zone)
  return time_zone unless time_zone
  ActiveSupport::TimeZone[time_zone] || raise(ArgumentError, "Invalid Timezone: #{time_zone}")
end