Class: TitleBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/services/title_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ TitleBuilder

Returns a new instance of TitleBuilder.



2
3
4
# File 'app/services/title_builder.rb', line 2

def initialize(template)
  @template = template
end

Instance Method Details

#build(item, settings, parameters) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/services/title_builder.rb', line 6

def build(item, settings, parameters)
  s = @template

  s = substitute_parameters(s, parameters)
  s = substitute_settings(s, settings)
  s = substitute_item(s, item)
  s = substitute_time(s, settings)

  s
end