Class: Draper::HelperProxy
- Inherits:
-
Object
- Object
- Draper::HelperProxy
- Defined in:
- lib/draper/helper_proxy.rb
Overview
Provides access to helper methods - both Rails built-in helpers, and those defined in your application.
Instance Method Summary collapse
-
#initialize(view_context) ⇒ HelperProxy
constructor
A new instance of HelperProxy.
-
#respond_to_missing?(method, include_private = false) ⇒ Boolean
Checks if the context responds to an instance method, or is able to proxy it to the view context.
Constructor Details
#initialize(view_context) ⇒ HelperProxy
Returns a new instance of HelperProxy.
6 7 8 |
# File 'lib/draper/helper_proxy.rb', line 6 def initialize(view_context) @view_context = view_context end |
Instance Method Details
#respond_to_missing?(method, include_private = false) ⇒ Boolean
Checks if the context responds to an instance method, or is able to proxy it to the view context.
18 19 20 |
# File 'lib/draper/helper_proxy.rb', line 18 def respond_to_missing?(method, include_private = false) super || view_context.respond_to?(method) end |