Class: Thredded::AllViewHooks::ViewHook

Inherits:
Object
  • Object
show all
Defined in:
app/view_hooks/thredded/all_view_hooks.rb

Overview

Contains the view hook content and can render a view hook.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeViewHook

Returns a new instance of ViewHook.



130
131
132
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 130

def initialize
  @config = Thredded::ViewHooks::Config.new
end

Instance Attribute Details

#configThredded::ViewHooks::Config (readonly)



128
129
130
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 128

def config
  @config
end

Instance Method Details

#render(view_context, **args, &block) ⇒ String

Returns:

  • (String)


135
136
137
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 135

def render(view_context, **args, &block)
  Thredded::ViewHooks::Renderer.new(view_context, @config).render(**args, &block)
end