Class: Alki::Execution::OverlayMap
- Inherits:
-
Object
- Object
- Alki::Execution::OverlayMap
- Defined in:
- lib/alki/execution/overlay_map.rb
Instance Method Summary collapse
- #add(path, *overlays) ⇒ Object
- #index(key, tags) ⇒ Object
-
#initialize(overlays = {}) ⇒ OverlayMap
constructor
A new instance of OverlayMap.
- #overlays ⇒ Object
Constructor Details
#initialize(overlays = {}) ⇒ OverlayMap
Returns a new instance of OverlayMap.
4 5 6 |
# File 'lib/alki/execution/overlay_map.rb', line 4 def initialize( = {}) @overlays = end |
Instance Method Details
#add(path, *overlays) ⇒ Object
26 27 28 29 |
# File 'lib/alki/execution/overlay_map.rb', line 26 def add(path,*) @overlays[path] ||= [] @overlays[path].push * end |
#index(key, tags) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/alki/execution/overlay_map.rb', line 8 def index(key,) self.class.new.tap do || @overlays.each do |target,| target = target.dup if target.size == 1 && target[0].to_s.start_with?('%') if tag = target[0].to_s[1..-1].to_sym .elements_in(tag).each do |path| .add path, * end end elsif target.empty? || target.shift == key.to_sym .add target, * end end end end |
#overlays ⇒ Object
31 32 33 34 |
# File 'lib/alki/execution/overlay_map.rb', line 31 def = @overlays[[]] || [] .sort_by(&:order).group_by(&:type) end |