Class: PolyglotFlutter::Serializer::Localization::Base
- Inherits:
-
Object
- Object
- PolyglotFlutter::Serializer::Localization::Base
- Includes:
- ERB::Util, Helper::General
- Defined in:
- lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb
Direct Known Subclasses
Constant Summary
Constants included from Helper::General
Helper::General::ESCAPE_KEYWORDS
Instance Attribute Summary collapse
-
#languages ⇒ Object
Returns the value of attribute languages.
-
#translation_keys ⇒ Object
Returns the value of attribute translation_keys.
Instance Method Summary collapse
-
#initialize(languages: nil, translation_keys: nil, mandatory_language: nil) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
- #save(_path) ⇒ Object
- #template ⇒ Object
Methods included from Helper::General
#clean_enum_name, #clean_variable_name, #config, #escape_keyword_if_needed, #escape_with_underscore_if_needed, #extract_translations, #generate_locales, #generate_localization_keys, #indent, #mandatory_language, #programming_language, #project_configs, #token, #use_old_naming
Constructor Details
#initialize(languages: nil, translation_keys: nil, mandatory_language: nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 |
# File 'lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb', line 9 def initialize(languages: nil, translation_keys: nil, mandatory_language: nil) @languages = languages @translation_keys = translation_keys @mandatory_language = mandatory_language end |
Instance Attribute Details
#languages ⇒ Object
Returns the value of attribute languages.
7 8 9 |
# File 'lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb', line 7 def languages @languages end |
#translation_keys ⇒ Object
Returns the value of attribute translation_keys.
7 8 9 |
# File 'lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb', line 7 def translation_keys @translation_keys end |
Instance Method Details
#render ⇒ Object
15 16 17 |
# File 'lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb', line 15 def render ERB.new(template, nil, '-').result(binding) end |
#save(_path) ⇒ Object
23 24 25 |
# File 'lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb', line 23 def save(_path) raise NotImplementedError, 'Abstract Method' end |
#template ⇒ Object
19 20 21 |
# File 'lib/flutter_polyglot_cli/serializers/localizations/loc_serializer.rb', line 19 def template raise NotImplementedError, 'Abstract Method' end |