Sha256: 24dfc51e20f2bc7f95b0a67e172406fb44a56e25a69183133f09ae76ed71153c

Contents?: true

Size: 711 Bytes

Versions: 42

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

module Thredded
  module ViewHooks
    class Config
      def initialize
        # @type Array<Proc>
        @before = []
        # @type Array<Proc>
        @replace = []
        # @type Array<Proc>
        @after = []
      end

      # @param [Proc] block
      # @return [Array<Proc>]
      def before(&block)
        @before << block if block
        @before
      end

      # @param [Proc] block
      # @return [Array<Proc>]
      def replace(&block)
        @replace << block if block
        @replace
      end

      # @param [Proc] block
      # @return [Array<Proc>]
      def after(&block)
        @after << block if block
        @after
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
thredded-1.1.0 lib/thredded/view_hooks/config.rb
thredded-1.0.1 lib/thredded/view_hooks/config.rb
thredded-1.0.0 lib/thredded/view_hooks/config.rb
thredded-0.16.16 lib/thredded/view_hooks/config.rb
thredded-0.16.15 lib/thredded/view_hooks/config.rb
thredded-0.16.14 lib/thredded/view_hooks/config.rb
thredded-0.16.13 lib/thredded/view_hooks/config.rb
thredded-0.16.12 lib/thredded/view_hooks/config.rb
thredded-0.16.11 lib/thredded/view_hooks/config.rb
thredded-0.16.10 lib/thredded/view_hooks/config.rb
thredded-0.16.9 lib/thredded/view_hooks/config.rb
thredded-0.16.8 lib/thredded/view_hooks/config.rb
thredded-0.16.7 lib/thredded/view_hooks/config.rb
thredded-0.16.6 lib/thredded/view_hooks/config.rb
thredded-0.16.5 lib/thredded/view_hooks/config.rb
thredded-0.16.4 lib/thredded/view_hooks/config.rb
thredded-0.16.3 lib/thredded/view_hooks/config.rb
thredded-0.16.1 lib/thredded/view_hooks/config.rb
thredded-0.16.0 lib/thredded/view_hooks/config.rb
thredded-0.15.5 lib/thredded/view_hooks/config.rb