File: group.rb

package info (click to toggle)
ruby-cucumber-expressions 8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 248 kB
  • sloc: ruby: 1,594; sh: 15; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Cucumber
  module CucumberExpressions
    class Group
      attr_reader :value, :start, :end, :children

      def initialize(value, start, _end, children)
        @value = value
        @start = start
        @end = _end
        @children = children
      end

      def values
        (children.empty? ? [self] : children).map(&:value).compact
      end
    end
  end
end