Module: Context::BaseContextHelper

Defined in:
lib/context/base_context_helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



3
4
5
6
7
8
9
# File 'lib/context/base_context_helper.rb', line 3

def method_missing(method_name, *args, &block)
    if @__context && @__context.has_view_helper?(method_name)
    @__context.public_send(method_name, *args, &block)
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/context/base_context_helper.rb', line 11

def respond_to_missing?(method_name, _include_private = false)
  @__context.has_view_helper?(method_name)
end