Module: Attentive::Config

Included in:
Attentive
Defined in:
lib/attentive/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_prohibited_contextsObject

Returns the value of attribute default_prohibited_contexts.



8
9
10
# File 'lib/attentive/config.rb', line 8

def default_prohibited_contexts
  @default_prohibited_contexts
end

#default_required_contextsObject

Returns the value of attribute default_required_contexts.



7
8
9
# File 'lib/attentive/config.rb', line 7

def default_required_contexts
  @default_required_contexts
end

#invocationsObject

Returns the value of attribute invocations.



6
7
8
# File 'lib/attentive/config.rb', line 6

def invocations
  @invocations
end

Instance Method Details

#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