class Oprah::ControllerHelpers::ViewContextProxy

A proxy class to delegate method calls to view contexts in presenters to the most recently created view context by {ControllerHelpers#view_context}.

`ViewContextProxy` objects are automatically created in {ControllerHelpers#present} and {ControllerHelpers#present_many} and shouldn't have to be created manually.

@since 0.1.3

Public Class Methods

new(controller) click to toggle source

@param [ActionController::Base] controller

The controller to delegate to.
# File lib/oprah/controller_helpers.rb, line 17
def initialize(controller)
  @controller = controller
end

Public Instance Methods

method_missing(meth, *args, &block) click to toggle source

Delegates all method calls to the `ActionView::Base` returned from {ControllerHelpers#oprah_view_context}.

# File lib/oprah/controller_helpers.rb, line 23
def method_missing(meth, *args, &block)
  @controller.oprah_view_context.__send__(meth, *args, &block)
end