Class: AdLocalize::Interactors::Platforms::ExportPlatformFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_localize/interactors/platforms/export_platform_factory.rb

Instance Method Summary collapse

Instance Method Details

#android_builderObject



30
31
32
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 30

def android_builder
  @android_builder ||= ExportAndroidLocaleWording.new
end

#build(platform:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 5

def build(platform:)
  case platform
  when 'json'
    json_builder
  when 'yml'
    yaml_builder
  when 'android'
    android_builder
  when 'ios'
    ios_builder
  when 'properties'
    properties_builder
  else
    raise ArgumentError.new('Unknown platform for builder factory')
  end
end

#ios_builderObject



34
35
36
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 34

def ios_builder
  @ios_builder ||= ExportIOSLocaleWording.new
end

#json_builderObject



22
23
24
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 22

def json_builder
  @json_builder ||= ExportJSONLocaleWording.new
end

#properties_builderObject



38
39
40
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 38

def properties_builder
  @properties_builder ||= ExportPropertiesLocaleWording.new
end

#yaml_builderObject



26
27
28
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 26

def yaml_builder
  @yaml_builder ||= ExportYAMLLocaleWording.new
end