class Aigu::Rails::Accent::LocaleReloader

Public Class Methods

new(locale:) click to toggle source
# File lib/aigu-rails/accent/locale_reloader.rb, line 5
def initialize(locale:)
  @locale = locale
end

Public Instance Methods

reload!() click to toggle source
# File lib/aigu-rails/accent/locale_reloader.rb, line 9
def reload!
  # Download the file from Accent
  downloader.download!

  # Process the file with aigu
  importer.import!

  # Reload Rails locales
  I18n.reload!
end

Protected Instance Methods

downloader() click to toggle source
# File lib/aigu-rails/accent/locale_reloader.rb, line 22
def downloader
  LocaleDownloader.new(locale: @locale)
end
importer() click to toggle source
# File lib/aigu-rails/accent/locale_reloader.rb, line 26
def importer
  LocaleImporter.new(locale: @locale)
end