Class: Blackbriar::MapExtract

Inherits:
Object
  • Object
show all
Defined in:
lib/blackbriar/map_extract.rb

Instance Method Summary collapse

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

#outputObject



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