Class: Tataru::Representations::HashRepresentation

Inherits:
Tataru::Representation show all
Defined in:
lib/tataru/representations/hash_representation.rb

Overview

representing hashes

Instance Attribute Summary

Attributes inherited from Tataru::Representation

#value

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ HashRepresentation

Returns a new instance of HashRepresentation.



7
8
9
10
11
# File 'lib/tataru/representations/hash_representation.rb', line 7

def initialize(value)
  @value = value.map do |key, thing|
    [key, Resolver.new(thing).representation]
  end.to_h
end

Instance Method Details

#dependenciesObject



13
14
15
16
17
# File 'lib/tataru/representations/hash_representation.rb', line 13

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