Sha256: e97735b41d813b3248ad4553219addb83ed8204ee06abbc90d4ee508f6dca2e0

Contents?: true

Size: 546 Bytes

Versions: 7

Compression:

Stored size: 546 Bytes

Contents

# encoding: utf-8

module Adhearsion
  class CallController
    module MenuDSL

      class StringMatchCalculator < MatchCalculator

        def match(query)
          args = { :query => query, :exact_matches => nil, :potential_matches => nil }

          if pattern == query.to_s
            args[:exact_matches] = [pattern]
          elsif pattern.starts_with? query.to_s
            args[:potential_matches] = [pattern]
          end

          new_calculated_match args
        end

      end # class StringMatchCalculator

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adhearsion-2.1.3 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb
adhearsion-2.1.2 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb
adhearsion-2.1.1 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb
adhearsion-2.1.0 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb
adhearsion-2.0.1 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb
adhearsion-2.0.0 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb
adhearsion-2.0.0.rc5 lib/adhearsion/call_controller/menu_dsl/string_match_calculator.rb