class Cucumber::CucumberExpressions::ParameterTypeMatcher

Attributes

parameter_type[R]

Public Class Methods

new(parameter_type, regexp, text, match_position=0) click to toggle source
# File lib/cucumber/cucumber_expressions/parameter_type_matcher.rb, line 6
def initialize(parameter_type, regexp, text, match_position=0)
  @parameter_type, @regexp, @text = parameter_type, regexp, text
  @match = @regexp.match(@text, match_position)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/cucumber/cucumber_expressions/parameter_type_matcher.rb, line 27
def <=>(other)
  pos_comparison = start <=> other.start
  return pos_comparison if pos_comparison != 0
  length_comparison = other.group.length <=> group.length
  return length_comparison if length_comparison != 0
  0
end
advance_to(new_match_position) click to toggle source
# File lib/cucumber/cucumber_expressions/parameter_type_matcher.rb, line 11
def advance_to(new_match_position)
  self.class.new(parameter_type, @regexp, @text, new_match_position)
end
find() click to toggle source
# File lib/cucumber/cucumber_expressions/parameter_type_matcher.rb, line 15
def find
  !@match.nil? && !group.empty?
end
group() click to toggle source
# File lib/cucumber/cucumber_expressions/parameter_type_matcher.rb, line 23
def group
  @match.captures[0]
end
start() click to toggle source
# File lib/cucumber/cucumber_expressions/parameter_type_matcher.rb, line 19
def start
  @match.begin(0)
end