Method: Attentive::Config#substitutions

Defined in:
lib/attentive/config.rb

#substitutionsObject



15
16
17
18
19
20
21
22
23
# File 'lib/attentive/config.rb', line 15

def substitutions
  return @substitutions if defined?(@substitutions)
  @substitutions = Attentive::Trie.of_substitutions(
    Attentive::SUBSTITUTIONS.merge(
      invocations.each_with_object({}) { |invocation, hash|
        tokens = Attentive.tokenize(invocation, substitutions: false)
        hash[tokens] = [Attentive::Tokens::Invocation.new(invocation, 0)]
      } ) )
end