Class: TwitterCldr::Timezones::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/timezones/location.rb

Direct Known Subclasses

GenericLocation, GmtLocation, Iso8601Location

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tz) ⇒ Location

Returns a new instance of Location.



6
7
8
# File 'lib/twitter_cldr/timezones/location.rb', line 6

def initialize(tz)
  @tz = tz
end

Instance Attribute Details

#tzObject (readonly)

Returns the value of attribute tz.



4
5
6
# File 'lib/twitter_cldr/timezones/location.rb', line 4

def tz
  @tz
end

Instance Method Details

#resourceObject



14
15
16
# File 'lib/twitter_cldr/timezones/location.rb', line 14

def resource
  @resource ||= TwitterCldr.get_locale_resource(tz.locale, :timezones)[tz.locale]
end

#tz_idObject



10
11
12
# File 'lib/twitter_cldr/timezones/location.rb', line 10

def tz_id
  tz.identifier
end