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.



4
5
6
# File 'app/services/title_builder.rb', line 4

def initialize(template)
  @template = template
end

Instance Method Details

#build(item, settings, parameters) ⇒ Object



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

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

  str = substitute_parameters(str, parameters)
  str = substitute_settings(str, settings)
  str = substitute_item(str, item)
  substitute_time(str, settings)
end