Class: Cucumber::CucumberExpressions::GroupBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGroupBuilder

Returns a new instance of GroupBuilder.



8
9
10
11
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 8

def initialize
  @group_builders = []
  @capturing = true
end

Instance Attribute Details

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 6

def source
  @source
end

Instance Method Details

#add(group_builder) ⇒ Object



13
14
15
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 13

def add(group_builder)
  @group_builders.push(group_builder)
end

#build(match, group_indices) ⇒ Object



17
18
19
20
21
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 17

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

#capturing?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 27

def capturing?
  @capturing
end

#childrenObject



37
38
39
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 37

def children
  @group_builders
end

#move_children_to(group_builder) ⇒ Object



31
32
33
34
35
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 31

def move_children_to(group_builder)
  @group_builders.each do |child|
    group_builder.add(child)
  end
end

#set_non_capturing!Object



23
24
25
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/group_builder.rb', line 23

def set_non_capturing!
  @capturing = false
end