Sha256: b7d4dffd9f838adc5c390fc82a39802c0282cef9efce5da2521ea0edfb83a561
Contents?: true
Size: 1.66 KB
Versions: 3
Compression:
Stored size: 1.66 KB
Contents
# frozen_string_literal: true module Thredded class AllViewHooks # @return [PostForm] attr_reader :post_form # @return [ModerationUserPage] attr_reader :moderation_user_page @instance = nil class << self # @return [Thredded::AllViewHooks] attr_reader :instance # Called when the class is reloaded so that server restart is not required # when changing view hooks in development. def reset_instance! @instance = Thredded::AllViewHooks.new end end def initialize @post_form = PostForm.new @moderation_user_page = ModerationUserPage.new end class PostForm # @return [Thredded::AllViewHooks::ViewHook] attr_reader :content_text_area def initialize @content_text_area = ViewHook.new end end class ModerationUserPage # @return [Thredded::AllViewHooks::ViewHook] attr_reader :user_title # @return [Thredded::AllViewHooks::ViewHook] attr_reader :user_info # @return [Thredded::AllViewHooks::ViewHook] attr_reader :user_moderation_actions def initialize @user_title = ViewHook.new @user_info = ViewHook.new @user_moderation_actions = ViewHook.new end end # Contains the view hook content and can render a view hook. class ViewHook # @return [Thredded::ViewHooks::Config] attr_reader :config def initialize @config = Thredded::ViewHooks::Config.new end # @return [String] def render(view_context, **args, &block) Thredded::ViewHooks::Renderer.new(view_context, @config).render(**args, &block) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
thredded-0.9.3 | app/view_hooks/thredded/all_view_hooks.rb |
thredded-0.9.2 | app/view_hooks/thredded/all_view_hooks.rb |
thredded-0.9.1 | app/view_hooks/thredded/all_view_hooks.rb |