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.



151
152
153
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 151

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

Instance Attribute Details

#configThredded::ViewHooks::Config (readonly)



149
150
151
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 149

def config
  @config
end

Instance Method Details

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

Returns:

  • (String)


156
157
158
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 156

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