Class: PolyglotIos::Serializer::Source::TranslationCase

Inherits:
Object
  • Object
show all
Includes:
Helper::General
Defined in:
lib/ios_polyglot_cli/serializers/sources/swift_helpers/translation_case.rb

Constant Summary

Constants included from Helper::General

Helper::General::ESCAPE_KEYWORDS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::General

#clean_case_name, #clean_enum_name, #clean_variable_name, #config, #escape_keyword_if_needed, #escape_with_underscore_if_needed, #indent, #programming_language, #project_configs, #skip_writing_language_struct, #token, #token_env_variable, #url, #use_old_naming

Methods included from Helper::Terminal

#generate_token_message, #prompt, #success

Constructor Details

#initialize(name, value) ⇒ TranslationCase

Returns a new instance of TranslationCase.



10
11
12
13
# File 'lib/ios_polyglot_cli/serializers/sources/swift_helpers/translation_case.rb', line 10

def initialize(name, value)
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/ios_polyglot_cli/serializers/sources/swift_helpers/translation_case.rb', line 7

def name
  @name
end

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/ios_polyglot_cli/serializers/sources/swift_helpers/translation_case.rb', line 8

def value
  @value
end

Instance Method Details

#serializedObject



15
16
17
18
# File 'lib/ios_polyglot_cli/serializers/sources/swift_helpers/translation_case.rb', line 15

def serialized()
  clean_name = clean_case_name(name)
  "public static let #{clean_name}: Strings = \"#{value}\""
end