File: //usr/local/rvm/gems/ruby-3.0.2/doc/tzinfo-2.0.4/ri/TZInfo/DataSource/set-c.ri
U:RDoc::AnyMethod[iI"set:ETI"TZInfo::DataSource::set;TT:publico:RDoc::Markup::Document:@parts[#o:RDoc::Markup::Paragraph; [I"LSets the currently selected data source for time zone and country data.;To:RDoc::Markup::BlankLine o;
; [I"MThis should usually be set to one of the two standard data source types:;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o;
; [I"L`:ruby` - read data from the Ruby modules included in the TZInfo::Data ;TI"library (tzinfo-data gem).;To;;0; [o;
; [I"H`:zoneinfo` - read data from the zoneinfo files included with most ;TI"?Unix-like operating systems (e.g. in /usr/share/zoneinfo).;T@o;
; [I"FTo set TZInfo to use one of the standard data source types, call ;TI"<`TZInfo::DataSource.set`` in one of the following ways:;T@o:RDoc::Markup::Verbatim; [ I"#TZInfo::DataSource.set(:ruby)
;TI"'TZInfo::DataSource.set(:zoneinfo)
;TI"5TZInfo::DataSource.set(:zoneinfo, zoneinfo_dir)
;TI"GTZInfo::DataSource.set(:zoneinfo, zoneinfo_dir, iso3166_tab_file)
;T:@format0o;
; [
I"L`DataSource.set(:zoneinfo)` will automatically search for the zoneinfo ;TI"2directory by checking the paths specified in ;TI"4{DataSources::ZoneinfoDataSource.search_path}. ;TI"I{DataSources::ZoneinfoDirectoryNotFound} will be raised if no valid ;TI"'zoneinfo directory could be found.;T@o;
; [ I"B`DataSource.set(:zoneinfo, zoneinfo_dir)` uses the specified ;TI"L`zoneinfo_dir` directory as the data source. If the directory is not a ;TI"Ivalid zoneinfo directory, a {DataSources::InvalidZoneinfoDirectory} ;TI"exception will be raised.;T@o;
; [
I"J`DataSource.set(:zoneinfo, zoneinfo_dir, iso3166_tab_file)` uses the ;TI"Jspecified `zoneinfo_dir` directory as the data source, but loads the ;TI"J`iso3166.tab` file from the path given by `iso3166_tab_file`. If the ;TI"4directory is not a valid zoneinfo directory, a ;TI"F{DataSources::InvalidZoneinfoDirectory} exception will be raised.;T@o;
; [I"NCustom data sources can be created by subclassing TZInfo::DataSource and ;TI"(implementing the following methods:;T@o;;
;;[
o;;0; [o;
; [I"{load_timezone_info};To;;0; [o;
; [I" {data_timezone_identifiers};To;;0; [o;
; [I""{linked_timezone_identifiers};To;;0; [o;
; [I"{load_country_info};To;;0; [o;
; [I"{country_codes};T@o;
; [I"GTo have TZInfo use the custom data source, call {DataSource.set}, ;TI"Mpassing an instance of the custom data source implementation as follows:;T@o;; [I"2TZInfo::DataSource.set(CustomDataSource.new)
;T;0o;
; [ I"KCalling {DataSource.set} will only affect instances of {Timezone} and ;TI"L{Country} obtained with {Timezone.get} and {Country.get} subsequent to ;TI"Lthe {DataSource.set} call. Existing {Timezone} and {Country} instances ;TI"will be unaffected.;T@o;
; [
I"NIf {DataSource.set} is not called, TZInfo will by default attempt to use ;TI"MTZInfo::Data as the data source. If TZInfo::Data is not available (i.e. ;TI"Fif `require 'tzinfo/data'` fails), then TZInfo will search for a ;TI"Dzoneinfo directory instead (using the search path specified by ;TI"4{DataSources::ZoneinfoDataSource.search_path}).;T@o;
; [I"J@param data_source_or_type [Object] either `:ruby`, `:zoneinfo` or an;To;; [I"!instance of a {DataSource}.
;T;0o;
; [I"H@param args [Array<Object>] when `data_source_or_type` is a symbol,;To;; [I"Boptional arguments to use when initializing the data source.
;T;0o;
; [I"D@raise [ArgumentError] if `data_source_or_type` is not `:ruby`,;To;; [I"0`:zoneinfo` or an instance of {DataSource}.;T;0:
@fileI"lib/tzinfo/data_source.rb;T:0@omit_headings_from_table_of_contents_below000[ I"!(data_source_or_type, *args);T@~FI"DataSource;TcRDoc::NormalClass00