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



32
33
34
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 32

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
21
22
# 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
  when 'csv'
    csv_builder
  else
    raise ArgumentError.new('Unknown platform for builder factory')
  end
end

#csv_builderObject



44
45
46
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 44

def csv_builder
  @csv_builder ||= ExportCSVLocaleWording.new
end

#ios_builderObject



36
37
38
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 36

def ios_builder
  @ios_builder ||= ExportIOSLocaleWording.new
end

#json_builderObject



24
25
26
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 24

def json_builder
  @json_builder ||= ExportJSONLocaleWording.new
end

#properties_builderObject



40
41
42
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 40

def properties_builder
  @properties_builder ||= ExportPropertiesLocaleWording.new
end

#yaml_builderObject



28
29
30
# File 'lib/ad_localize/interactors/platforms/export_platform_factory.rb', line 28

def yaml_builder
  @yaml_builder ||= ExportYAMLLocaleWording.new
end