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