Class: StrongPresenter::HelperProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/strong_presenter/helper_proxy.rb

Overview

Copied from Draper::HelperProxy

Instance Method Summary collapse

Constructor Details

#initialize(view_context) ⇒ HelperProxy

Returns a new instance of HelperProxy.



9
10
11
# File 'lib/strong_presenter/helper_proxy.rb', line 9

def initialize(view_context)
  @view_context = view_context
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Sends helper methods to the view context.



14
15
16
17
# 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