Sha256: afd3eea6ce9efbfa4789b7c920f4bd146d4457084eab0139b67289a0ce9e56e7

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module Tataru
  module Representations
    # representing hashes
    class HashRepresentation < Representation
      def initialize(value)
        @value = value.map do |key, thing|
          [key, Resolver.new(thing).representation]
        end.to_h
      end

      def dependencies
        @dependencies ||= @value.flat_map do |_key, rep|
          rep.dependencies
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tataru-0.2.0 lib/tataru/representations/hash_representation.rb