Class: Alki::Assembly::Meta::Overlay
- Inherits:
-
Object
- Object
- Alki::Assembly::Meta::Overlay
- Defined in:
- lib/alki/assembly/meta/overlay.rb
Instance Method Summary collapse
-
#initialize(type, target, overlay, args) ⇒ Overlay
constructor
A new instance of Overlay.
- #process(executor, from, data) ⇒ Object
Constructor Details
#initialize(type, target, overlay, args) ⇒ Overlay
Returns a new instance of Overlay.
9 10 11 12 13 14 |
# File 'lib/alki/assembly/meta/overlay.rb', line 9 def initialize(type,target,,args) @type = type @target = target @overlay = @args = args end |
Instance Method Details
#process(executor, from, data) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/alki/assembly/meta/overlay.rb', line 16 def process(executor,from,data) data[:total_overlays] ||= 0 data[:overlays] ||= Execution::OverlayMap.new target_path = @target.dup if target_path.last.to_s.start_with?('%') tag = target_path.pop end if target_path == [] target_path = [:root] end target = executor.canonical_path(from,target_path) or raise InvalidPathError.new("Invalid overlay target #{@target.join('.')}") target = target.dup.push tag if tag = @overlay if .is_a?(Array) = executor.canonical_path(from,@overlay) or raise InvalidPathError.new("Invalid overlay path #{@overlay.join('.')}") end order = data[:total_overlays] data[:overlays].add target, OverlayInfo.new(order,@type, , @args) data[:total_overlays] += 1 end |