Module: ViewContextFrill

Includes:
Frill
Defined in:
app/frills/view_context_frill.rb

Class Method Summary collapse

Methods included from Frill

decorate, decorators, dependency_graph, included, reset!

Class Method Details

.frill?(object, context) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/frills/view_context_frill.rb', line 4

def self.frill? object, context
  object.class_eval do
    define_method :helpers do
      @frill_helper ||= context.respond_to?(:view_context) ? context.view_context : context
    end

    define_method :h do
      helpers
    end
  end

  false
end