Class: SetupConfiguration::Legacy::LanguageContext
- Inherits:
-
Object
- Object
- SetupConfiguration::Legacy::LanguageContext
- Defined in:
- lib/setup_configuration/legacy/language_context.rb
Instance Attribute Summary collapse
-
#lang_abbr ⇒ Object
readonly
Returns the value of attribute lang_abbr.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #categories ⇒ Object
- #category_name(cat) ⇒ Object
-
#initialize(name, lang, helper) ⇒ LanguageContext
constructor
A new instance of LanguageContext.
- #parameter_description(param) ⇒ Object
- #parameter_name(param) ⇒ Object
Constructor Details
#initialize(name, lang, helper) ⇒ LanguageContext
Returns a new instance of LanguageContext.
10 11 12 13 14 15 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 10 def initialize(name, lang, helper) @lang=lang @helper=helper @lang_abbr= SetupConfiguration::Translation.language_abbreviation(lang) @output = SetupConfiguration::Translation.translation_file(name, @lang_abbr) end |
Instance Attribute Details
#lang_abbr ⇒ Object (readonly)
Returns the value of attribute lang_abbr.
7 8 9 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 7 def lang_abbr @lang_abbr end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
8 9 10 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 8 def output @output end |
Instance Method Details
#categories ⇒ Object
31 32 33 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 31 def categories @helper.categories.sort end |
#category_name(cat) ⇒ Object
17 18 19 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 17 def category_name(cat) @helper.category_name_raw(@lang, cat) end |
#parameter_description(param) ⇒ Object
26 27 28 29 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 26 def parameter_description(param) #TODO escape ($$ into \n) @helper.parameter_description(@lang, param.to_i) end |
#parameter_name(param) ⇒ Object
21 22 23 |
# File 'lib/setup_configuration/legacy/language_context.rb', line 21 def parameter_name(param) @helper.param_name(@lang, param) end |