class Cucumber::CucumberExpressions::ParameterType

def initialize(name, regexp, type, transformer, use_for_snippets, prefer_for_regexp_match)

Parameters:
  • prefer_for_regexp_match () -- true if this should be preferred over similar types
  • use_for_snippets () -- true if this should be used for snippet generation
  • transformer () -- lambda that transforms a String to (possibly) another type
  • type () -- the return type of the transformed
  • regexp (Array) -- list of regexps for capture groups. A single regexp can also be used
  • name () -- the name of the parameter type
def initialize(name, regexp, type, transformer, use_for_snippets, prefer_for_regexp_match)
  raise "regexp can't be nil" if regexp.nil?
  raise "type can't be nil" if type.nil?
  raise "transformer can't be nil" if transformer.nil?
  raise "use_for_snippets can't be nil" if use_for_snippets.nil?
  raise "prefer_for_regexp_match can't be nil" if prefer_for_regexp_match.nil?
  self.class.check_parameter_type_name(name) unless name.nil?
  @name, @type, @transformer, @use_for_snippets, @prefer_for_regexp_match = name, type, transformer, use_for_snippets, prefer_for_regexp_match
  @regexps = string_array(regexp)
end