Class: Tataru::Representations::HashRepresentation
- Inherits:
-
Tataru::Representation
- Object
- Tataru::Representation
- Tataru::Representations::HashRepresentation
- Defined in:
- lib/tataru/representations/hash_representation.rb
Overview
representing hashes
Instance Attribute Summary
Attributes inherited from Tataru::Representation
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(value) ⇒ HashRepresentation
constructor
A new instance of HashRepresentation.
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
#dependencies ⇒ Object
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 |