Sha256: 0513fb7c09e52afea07ad7d87bf85c8ae0a353bec312b2baa85a66972d54dbb5

Contents?: true

Size: 775 Bytes

Versions: 38

Compression:

Stored size: 775 Bytes

Contents

require 'cucumber/cucumber_expressions/errors'
require 'cucumber/cucumber_expressions/cucumber_expression'
require 'cucumber/cucumber_expressions/regular_expression'

module Cucumber
  module CucumberExpressions
    class ExpressionFactory
      def initialize(parameter_type_registry)
        @parameter_type_registry = parameter_type_registry
      end

      def create_expression(string_or_regexp)
        case string_or_regexp
        when String then CucumberExpression.new(string_or_regexp, @parameter_type_registry)
        when Regexp then RegularExpression.new(string_or_regexp, @parameter_type_registry)
        else
          raise CucumberExpressionError.new("Can't create an expression from #{string_or_regexp.inspect}")
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 4 rubygems

Version Path
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-cucumber-expressions-16.1.2/lib/cucumber/cucumber_expressions/expression_factory.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/expression_factory.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/expression_factory.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-16.1.2 lib/cucumber/cucumber_expressions/expression_factory.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-16.1.1 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-16.1.0 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-16.0.1 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-16.0.0 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-15.2.0 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-15.1.1 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-15.1.0 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-15.0.2 lib/cucumber/cucumber_expressions/expression_factory.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-cucumber-expressions-14.0.0/lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-15.0.1 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-14.0.0 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-13.1.3 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-13.1.2 lib/cucumber/cucumber_expressions/expression_factory.rb
cucumber-cucumber-expressions-13.1.1 lib/cucumber/cucumber_expressions/expression_factory.rb