Class: Codebreaker::Localization
- Inherits:
-
Object
- Object
- Codebreaker::Localization
- Defined in:
- lib/codebreaker/localization.rb
Instance Attribute Summary collapse
-
#lang ⇒ Object
Returns the value of attribute lang.
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(app_type, external_path = false, lang = :en) ⇒ Localization
constructor
A new instance of Localization.
- #localization ⇒ Object
Constructor Details
#initialize(app_type, external_path = false, lang = :en) ⇒ Localization
Returns a new instance of Localization.
7 8 9 10 11 12 13 |
# File 'lib/codebreaker/localization.rb', line 7 def initialize(app_type, external_path = false, lang = :en) @lang = lang apply_external_path(external_path) select_application(app_type) candidates_to_load merge_localizations end |
Instance Attribute Details
#lang ⇒ Object
Returns the value of attribute lang.
5 6 7 |
# File 'lib/codebreaker/localization.rb', line 5 def lang @lang end |
Instance Method Details
#all ⇒ Object
20 21 22 |
# File 'lib/codebreaker/localization.rb', line 20 def all localizations.keys end |
#localization ⇒ Object
15 16 17 18 |
# File 'lib/codebreaker/localization.rb', line 15 def localization return localizations[:en] unless localizations[lang] localizations[lang] end |