class StrongPresenter::HelperProxy

Copied from Draper::HelperProxy

Attributes

view_context[R]

Public Class Methods

new(view_context) click to toggle source

@overload initialize(view_context)

# File lib/strong_presenter/helper_proxy.rb, line 9
def initialize(view_context)
  @view_context = view_context
end

Private Class Methods

define_proxy(name) click to toggle source
# File lib/strong_presenter/helper_proxy.rb, line 27
def self.define_proxy(name)
  define_method name do |*args, &block|
    view_context.send(name, *args, &block)
  end
end

Public Instance Methods

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

Sends helper methods to the view context.

# File lib/strong_presenter/helper_proxy.rb, line 14
def method_missing(method, *args, &block)
  self.class.define_proxy method
  send(method, *args, &block)
end