Class: Wee::Delegate
- Inherits:
-
Decoration
- Object
- Presenter
- Decoration
- Wee::Delegate
- Defined in:
- lib/wee/decoration.rb
Overview
A Wee::Delegate breaks the decoration chain and forwards the methods #process_callbacks, #render_on and #backtrack to the corresponding chain method of it’s delegate component (a Wee::Component).
Instance Attribute Summary
Attributes inherited from Decoration
Instance Method Summary collapse
-
#backtrack(state) ⇒ Object
Forwards method to the corresponding top-level chain method of the delegate component.
-
#initialize(delegate) ⇒ Delegate
constructor
A new instance of Delegate.
-
#process_callbacks(callbacks) ⇒ Object
Forwards method to the corresponding top-level chain method of the delegate component.
-
#render_on(r) ⇒ Object
Forwards method to the corresponding top-level chain method of the delegate component.
Methods inherited from Decoration
#global?, #render_presenter_on
Methods inherited from Presenter
Constructor Details
#initialize(delegate) ⇒ Delegate
169 170 171 |
# File 'lib/wee/decoration.rb', line 169 def initialize(delegate) @delegate = delegate end |
Instance Method Details
#backtrack(state) ⇒ Object
Forwards method to the corresponding top-level chain method of the delegate component. We also take snapshots of all non-visible components, thus we follow the @next decoration (via super).
194 195 196 197 |
# File 'lib/wee/decoration.rb', line 194 def backtrack(state) super @delegate.decoration.backtrack(state) end |
#process_callbacks(callbacks) ⇒ Object
Forwards method to the corresponding top-level chain method of the delegate component.
177 178 179 |
# File 'lib/wee/decoration.rb', line 177 def process_callbacks(callbacks) @delegate.decoration.process_callbacks(callbacks) end |
#render_on(r) ⇒ Object
Forwards method to the corresponding top-level chain method of the delegate component.
185 186 187 |
# File 'lib/wee/decoration.rb', line 185 def render_on(r) @delegate.decoration.render_on(r) end |