Class: PolyglotIos::Serializer::Language::Base

Inherits:
Object
  • Object
show all
Includes:
ERB::Util
Defined in:
lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb

Direct Known Subclasses

ObjC, Swift

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(languages) ⇒ Base

Returns a new instance of Base.



8
9
10
# File 'lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb', line 8

def initialize(languages)
  @languages = languages
end

Instance Attribute Details

#languagesObject

Returns the value of attribute languages.



6
7
8
# File 'lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb', line 6

def languages
  @languages
end

Instance Method Details

#renderObject



12
13
14
# File 'lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb', line 12

def render()
  ERB.new(template, trim_mode: '-').result(binding)
end

#save(path) ⇒ Object



20
21
22
# File 'lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb', line 20

def save(path)
  fail NotImplementedError, 'Abstract Method'
end

#templateObject



16
17
18
# File 'lib/ios_polyglot_cli/serializers/languages/languages_serializer.rb', line 16

def template()
  fail NotImplementedError, 'Abstract Method'
end