Class: Blackbriar::MapExtract
- Inherits:
-
Object
- Object
- Blackbriar::MapExtract
- Defined in:
- lib/blackbriar/map_extract.rb
Instance Method Summary collapse
-
#initialize(map, data) ⇒ MapExtract
constructor
A new instance of MapExtract.
- #output ⇒ Object
Constructor Details
#initialize(map, data) ⇒ MapExtract
Returns a new instance of MapExtract.
3 4 5 |
# File 'lib/blackbriar/map_extract.rb', line 3 def initialize(map, data) @map, @data = map, data end |
Instance Method Details
#output ⇒ Object
7 8 9 10 11 12 |
# File 'lib/blackbriar/map_extract.rb', line 7 def output provider = ValueProvider.new(data) map.to_a.map do |key, value| Node.new({key => value}, provider).resolve end.reduce(&:merge) end |