Class: AdLocalize::Serializers::TemplatedSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_localize/serializers/templated_serializer.rb

Instance Method Summary collapse

Constructor Details

#initialize(sanitizer:) ⇒ TemplatedSerializer

Returns a new instance of TemplatedSerializer.



5
6
7
# File 'lib/ad_localize/serializers/templated_serializer.rb', line 5

def initialize(sanitizer:)
  @sanitizer = sanitizer
end

Instance Method Details

#configure(export_request:) ⇒ Object



16
17
18
# File 'lib/ad_localize/serializers/templated_serializer.rb', line 16

def configure(export_request:)
  # override if you need flags from export_request
end

#render(locale_wording:) ⇒ Object



9
10
11
12
13
14
# File 'lib/ad_localize/serializers/templated_serializer.rb', line 9

def render(locale_wording:)
  variable_binding = variable_binding(locale_wording: locale_wording)
  return unless variable_binding

  render_template(template_path: template_path, variable_binding: variable_binding)
end