Class: TranslationEngine::Release
- Inherits:
-
Object
- Object
- TranslationEngine::Release
- Defined in:
- app/models/translation_engine/release.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #current? ⇒ Boolean
- #current_locale? ⇒ Boolean
-
#initialize(args) ⇒ Release
constructor
A new instance of Release.
Constructor Details
#initialize(args) ⇒ Release
Returns a new instance of Release.
13 14 15 16 17 |
# File 'app/models/translation_engine/release.rb', line 13 def initialize(args) @version = args[:version] @locale = args[:locale] @created_at = Time.parse(args[:created_at]) end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'app/models/translation_engine/release.rb', line 3 def created_at @created_at end |
#locale ⇒ Object
Returns the value of attribute locale.
3 4 5 |
# File 'app/models/translation_engine/release.rb', line 3 def locale @locale end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'app/models/translation_engine/release.rb', line 3 def version @version end |
Class Method Details
.master ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/models/translation_engine/release.rb', line 5 def self.master new( version: 'master', locale: 'all', created_at: Time.now.to_s ) end |
Instance Method Details
#current? ⇒ Boolean
23 24 25 |
# File 'app/models/translation_engine/release.rb', line 23 def current? I18n.backend.release == @version end |
#current_locale? ⇒ Boolean
19 20 21 |
# File 'app/models/translation_engine/release.rb', line 19 def current_locale? I18n.locale.to_s == @locale || @locale == 'all' end |