Module: Rails5BeforeRender::BeforeRender::ClassMethods

Defined in:
lib/before_render/before_render.rb

Instance Method Summary collapse

Instance Method Details

#append_before_render_filter(*names, &blk) ⇒ Object Also known as: before_render, append_before_render



15
16
17
18
19
# File 'lib/before_render/before_render.rb', line 15

def append_before_render_filter(*names, &blk)
    _insert_callbacks(names, blk) do |name, options|
        set_callback(:render, :before, name, options)
    end
end

#prepend_before_render_filter(*names, &blk) ⇒ Object Also known as: prepend_before_render



21
22
23
24
25
# File 'lib/before_render/before_render.rb', line 21

def prepend_before_render_filter(*names, &blk)
    _insert_callbacks(names, blk) do |name, options|
        set_callback(:render, :before, name, options.merge(:prepend => true))
    end
end

#skip_before_render_filter(*names, &blk) ⇒ Object Also known as: skip_before_render



27
28
29
30
31
# File 'lib/before_render/before_render.rb', line 27

def skip_before_render_filter(*names, &blk)
    _insert_callbacks(names, blk) do |name, options|
        skip_callback(:render, :before, name, options)
    end
end