Sha256: b904c50213495f1ec3fa88d1380b59459dcbc6f5ede4618943e79ad8bd67fe1b
Contents?: true
Size: 713 Bytes
Versions: 21
Compression:
Stored size: 713 Bytes
Contents
module JMESPath # @api private module Nodes class MultiSelectHash < Node def initialize(kv_pairs) @kv_pairs = kv_pairs end def visit(value) if value.nil? nil else @kv_pairs.each_with_object({}) do |pair, hash| hash[pair.key] = pair.value.visit(value) end end end def optimize self.class.new(@kv_pairs.map(&:optimize)) end class KeyValuePair attr_reader :key, :value def initialize(key, value) @key = key @value = value end def optimize self.class.new(@key, @value.optimize) end end end end end
Version data entries
21 entries across 21 versions & 3 rubygems