Module: Temple::Mixins::EngineDSL Private
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #after(name, *args, &block) ⇒ Object private
- #append(*args, &block) ⇒ Object (also: #use) private
- #before(name, *args, &block) ⇒ Object private
- #chain_modified! ⇒ Object private
- #prepend(*args, &block) ⇒ Object private
- #remove(name) ⇒ Object private
- #replace(name, *args, &block) ⇒ Object private
Instance Method Details
#after(name, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 41 |
# File 'lib/temple/mixins/engine_dsl.rb', line 35 def after(name, *args, &block) name = chain_name(name) e = chain_element(args, block) chain.map! {|f| name === f.first ? [f, e] : [f] }.flatten!(1) raise "#{name} not found" unless chain.include?(e) chain_modified! end |
#append(*args, &block) ⇒ Object Also known as: use
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 12 |
# File 'lib/temple/mixins/engine_dsl.rb', line 9 def append(*args, &block) chain << chain_element(args, block) chain_modified! end |
#before(name, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 30 31 32 33 |
# File 'lib/temple/mixins/engine_dsl.rb', line 27 def before(name, *args, &block) name = chain_name(name) e = chain_element(args, block) chain.map! {|f| name === f.first ? [e, f] : [f] }.flatten!(1) raise "#{name} not found" unless chain.include?(e) chain_modified! end |
#chain_modified! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 |
# File 'lib/temple/mixins/engine_dsl.rb', line 6 def chain_modified! end |
#prepend(*args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 17 |
# File 'lib/temple/mixins/engine_dsl.rb', line 14 def prepend(*args, &block) chain.unshift(chain_element(args, block)) chain_modified! end |
#remove(name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 22 23 |
# File 'lib/temple/mixins/engine_dsl.rb', line 19 def remove(name) name = chain_name(name) raise "#{name} not found" unless chain.reject! {|i| name === i.first } chain_modified! end |
#replace(name, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 46 47 48 49 |
# File 'lib/temple/mixins/engine_dsl.rb', line 43 def replace(name, *args, &block) name = chain_name(name) e = chain_element(args, block) chain.map! {|f| name === f.first ? e : f } raise "#{name} not found" unless chain.include?(e) chain_modified! end |