Sha256: ba395792f5a84b15682fb99fbd537caee5596cf5d049d7fa89d0cb19a0da9b91

Contents?: true

Size: 493 Bytes

Versions: 9

Compression:

Stored size: 493 Bytes

Contents

class TranslationEngine::Release

  attr_accessor :version, :locale, :created_at

  def self.master
    new(
      version:    'master',
      locale:     'all',
      created_at: Time.now.to_s
    )
  end

  def initialize(args)
    @version    = args[:version]
    @locale     = args[:locale]
    @created_at = Time.parse(args[:created_at])
  end

  def current_locale?
    I18n.locale.to_s == @locale || @locale == 'all'
  end

  def current?
    I18n.backend.release == @version
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
translation_engine-0.2.0 app/models/translation_engine/release.rb
translation_engine-0.1.0 app/models/translation_engine/release.rb
translation_engine-0.0.8 app/models/translation_engine/release.rb
translation_engine-0.0.7 app/models/translation_engine/release.rb
translation_engine-0.0.5 app/models/translation_engine/release.rb
translation_engine-0.0.4 app/models/translation_engine/release.rb
translation_engine-0.0.3 app/models/translation_engine/release.rb
translation_engine-0.0.2 app/models/translation_engine/release.rb
translation_engine-0.0.1 app/models/translation_engine/release.rb