Class: Adhearsion::VoIP::CalculatedMatchCollection
- Defined in:
- lib/adhearsion/voip/menu_state_machine/calculated_match.rb
Instance Attribute Summary collapse
-
#actual_exact_matches ⇒ Object
readonly
Returns the value of attribute actual_exact_matches.
-
#actual_potential_matches ⇒ Object
readonly
Returns the value of attribute actual_potential_matches.
-
#calculated_matches ⇒ Object
readonly
Returns the value of attribute calculated_matches.
-
#exact_matches ⇒ Object
readonly
Returns the value of attribute exact_matches.
-
#potential_matches ⇒ Object
readonly
Returns the value of attribute potential_matches.
Instance Method Summary collapse
- #<<(calculated_match) ⇒ Object
- #exact_match? ⇒ Boolean
- #exact_match_count ⇒ Object
-
#initialize ⇒ CalculatedMatchCollection
constructor
A new instance of CalculatedMatchCollection.
- #potential_match? ⇒ Boolean
- #potential_match_count ⇒ Object
Constructor Details
#initialize ⇒ CalculatedMatchCollection
Returns a new instance of CalculatedMatchCollection.
45 46 47 48 49 50 51 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 45 def initialize @calculated_matches = [] @potential_matches = [] @exact_matches = [] @actual_potential_matches = [] @actual_exact_matches = [] end |
Instance Attribute Details
#actual_exact_matches ⇒ Object (readonly)
Returns the value of attribute actual_exact_matches.
42 43 44 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 42 def actual_exact_matches @actual_exact_matches end |
#actual_potential_matches ⇒ Object (readonly)
Returns the value of attribute actual_potential_matches.
42 43 44 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 42 def actual_potential_matches @actual_potential_matches end |
#calculated_matches ⇒ Object (readonly)
Returns the value of attribute calculated_matches.
42 43 44 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 42 def calculated_matches @calculated_matches end |
#exact_matches ⇒ Object (readonly)
Returns the value of attribute exact_matches.
42 43 44 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 42 def exact_matches @exact_matches end |
#potential_matches ⇒ Object (readonly)
Returns the value of attribute potential_matches.
42 43 44 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 42 def potential_matches @potential_matches end |
Instance Method Details
#<<(calculated_match) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 53 def <<(calculated_match) calculated_matches << calculated_match actual_potential_matches.concat calculated_match.potential_matches actual_exact_matches.concat calculated_match.exact_matches potential_matches << calculated_match if calculated_match.potential_match? exact_matches << calculated_match if calculated_match.exact_match? end |
#exact_match? ⇒ Boolean
74 75 76 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 74 def exact_match? exact_match_count > 0 end |
#exact_match_count ⇒ Object
66 67 68 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 66 def exact_match_count actual_exact_matches.size end |
#potential_match? ⇒ Boolean
70 71 72 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 70 def potential_match? potential_match_count > 0 end |
#potential_match_count ⇒ Object
62 63 64 |
# File 'lib/adhearsion/voip/menu_state_machine/calculated_match.rb', line 62 def potential_match_count actual_potential_matches.size end |