Module: Pres::ViewDelegation
- Included in:
- Presenter
- Defined in:
- lib/pres/view_delegation.rb
Instance Method Summary collapse
-
#method_missing(symbol, *args, &block) ⇒ Object
Send missing symbols to view_context first.
- #respond_to_missing?(symbol, _ = false) ⇒ Boolean
- #view_context ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args, &block) ⇒ Object
Send missing symbols to view_context first
8 9 10 11 12 13 14 |
# File 'lib/pres/view_delegation.rb', line 8 def method_missing(symbol, *args, &block) if view_context.respond_to?(symbol, true) view_context.send(symbol, *args, &block) else super end end |
Instance Method Details
#respond_to_missing?(symbol, _ = false) ⇒ Boolean
16 17 18 |
# File 'lib/pres/view_delegation.rb', line 16 def respond_to_missing?(symbol, _ = false) view_context.respond_to?(symbol, true) || super end |
#view_context ⇒ Object
3 4 5 |
# File 'lib/pres/view_delegation.rb', line 3 def view_context @view_context end |