Class: Commute::Stack::Sequence
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Commute::Stack::Sequence
- Defined in:
- lib/commute/stack.rb
Overview
Represents one way of the Commute::Stack Delegates methods to the underlying layer array.
Instance Method Summary collapse
-
#after!(reference, insert) ⇒ Object
Insert a layer after another layer.
-
#before!(reference, inserting) ⇒ Object
Insert a layer before another layer.
-
#without!(*names) ⇒ Object
Remove some layers from this sequence.
Instance Method Details
#after!(reference, insert) ⇒ Object
Insert a layer after another layer.
41 42 43 |
# File 'lib/commute/stack.rb', line 41 def after! reference, insert insert((index { |layer| layer.name == reference }) + 1, insert) end |
#before!(reference, inserting) ⇒ Object
Insert a layer before another layer.
33 34 35 |
# File 'lib/commute/stack.rb', line 33 def before! reference, inserting insert(index { |layer| layer.name == reference }, inserting) end |
#without!(*names) ⇒ Object
Remove some layers from this sequence.
25 26 27 |
# File 'lib/commute/stack.rb', line 25 def without! *names reject! { |layer| names.include? layer.name } end |