class Cucumber::CucumberExpressions::ExpressionFactory

Public Class Methods

new(parameter_type_registry) click to toggle source
# File lib/cucumber/cucumber_expressions/expression_factory.rb, line 8
def initialize(parameter_type_registry)
  @parameter_type_registry = parameter_type_registry
end

Public Instance Methods

create_expression(string_or_regexp) click to toggle source
# File lib/cucumber/cucumber_expressions/expression_factory.rb, line 12
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