File: multi_select_list.rb

package info (click to toggle)
ruby-jmespath 1.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: ruby: 2,039; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true
module JMESPath
  # @api private
  module Nodes
    class MultiSelectList < Node
      def initialize(children)
        @children = children
      end

      def visit(value)
        if value.nil?
          value
        else
          @children.map { |n| n.visit(value) }
        end
      end

      def optimize
        self.class.new(@children.map(&:optimize))
      end
    end
  end
end