Class: TZInfo::DataSources::CountryInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/country_info.rb

Overview

Represents a country and references to its time zones as returned by a TZInfo::DataSource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, name, zones) ⇒ CountryInfo

Initializes a new TZInfo::DataSources::CountryInfo. The passed in ‘code`, `name` and `zones` instances will be frozen.

Raises:

  • (ArgumentError)

    if ‘code`, `name` or `zones` is `nil`.



26
27
28
29
30
31
32
33
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/country_info.rb', line 26

def initialize(code, name, zones)
  raise ArgumentError, 'code must be specified' unless code
  raise ArgumentError, 'name must be specified' unless name
  raise ArgumentError, 'zones must be specified' unless zones
  @code = code.freeze
  @name = name.freeze
  @zones = zones.freeze
end

Instance Attribute Details

#codeString (readonly)



10
11
12
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/country_info.rb', line 10

def code
  @code
end

#nameString (readonly)



13
14
15
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/country_info.rb', line 13

def name
  @name
end

#zonesArray<CountryTimezone> (readonly)



16
17
18
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/country_info.rb', line 16

def zones
  @zones
end

Instance Method Details

#inspectString



37
38
39
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/country_info.rb', line 37

def inspect
  "#<#{self.class}: #@code>"
end