Sha256: 644ec9c79e5e1b2762321299ba4ad2b9f5a3effaf6e9d3f1dff3d2b4e3cd1de4
Contents?: true
Size: 952 Bytes
Versions: 6
Compression:
Stored size: 952 Bytes
Contents
# frozen_string_literal: true require 'cucumber/cucumber_expressions/group' module Cucumber module CucumberExpressions class GroupBuilder attr_accessor :source def initialize @group_builders = [] @capturing = true end def add(group_builder) @group_builders.push(group_builder) end def build(match, group_indices) group_index = group_indices.next children = @group_builders.map { |gb| gb.build(match, group_indices) } Group.new(match[group_index], match.offset(group_index)[0], match.offset(group_index)[1], children) end def set_non_capturing! @capturing = false end def capturing? @capturing end def move_children_to(group_builder) @group_builders.each do |child| group_builder.add(child) end end def children @group_builders end end end end
Version data entries
6 entries across 6 versions & 2 rubygems