Class: Adhearsion::VoIP::MatchCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/adhearsion/voip/menu_state_machine/matchers.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, match_payload) ⇒ MatchCalculator

Returns a new instance of MatchCalculator.



31
32
33
# File 'lib/adhearsion/voip/menu_state_machine/matchers.rb', line 31

def initialize(pattern, match_payload)
  @pattern, @match_payload = pattern, match_payload
end

Instance Attribute Details

#match_payloadObject (readonly)

Returns the value of attribute match_payload.



30
31
32
# File 'lib/adhearsion/voip/menu_state_machine/matchers.rb', line 30

def match_payload
  @match_payload
end

#patternObject (readonly)

Returns the value of attribute pattern.



30
31
32
# File 'lib/adhearsion/voip/menu_state_machine/matchers.rb', line 30

def pattern
  @pattern
end

Class Method Details

.build_with_pattern(pattern, match_payload, &block) ⇒ Object



9
10
11
# File 'lib/adhearsion/voip/menu_state_machine/matchers.rb', line 9

def build_with_pattern(pattern, match_payload, &block)
  class_for_pattern_type(pattern.class.name).new(pattern, match_payload, &block)
end

.inherited(klass) ⇒ Object



13
14
15
# File 'lib/adhearsion/voip/menu_state_machine/matchers.rb', line 13

def inherited(klass)
  subclasses << klass
end