Sha256: 0961b3d75f2d47b509beba5c5a74da68818711cc720ab859c5288ea930d7533d
Contents?: true
Size: 894 Bytes
Versions: 15
Compression:
Stored size: 894 Bytes
Contents
module Cucumber module CucumberExpressions class ParameterTypeMatcher attr_reader :parameter_type def initialize(parameter_type, regexp, text, match_position=0) @parameter_type, @regexp, @text = parameter_type, regexp, text @match = @regexp.match(@text, match_position) end def advance_to(new_match_position) self.class.new(parameter_type, @regexp, @text, new_match_position) end def find !@match.nil? && !group.empty? end def start @match.begin(0) end def group @match.captures[0] end 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 end end end
Version data entries
15 entries across 15 versions & 2 rubygems