class EorzeaWeather::Localizer

Attributes

id[R]
kind[R]

Public Class Methods

new(kind, id) click to toggle source
# File lib/eorzea_weather/localizer.rb, line 6
def initialize(kind, id)
  @kind = kind
  @id = id
end

Public Instance Methods

[](locale) click to toggle source
# File lib/eorzea_weather/localizer.rb, line 13
def [](locale)
  to_h[locale] || id.to_s
end
to_h() click to toggle source
# File lib/eorzea_weather/localizer.rb, line 17
def to_h
  @hash ||= Data::Locales::MAP.map { |lid, locale| [lid, locale.__send__(kind)[id]] }.select { |(_,v)| v }.to_h
end