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.



115
116
117
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 115

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

Instance Attribute Details

#configThredded::ViewHooks::Config (readonly)



113
114
115
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 113

def config
  @config
end

Instance Method Details

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

Returns:

  • (String)


120
121
122
# File 'app/view_hooks/thredded/all_view_hooks.rb', line 120

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