Class: Thredded::ViewHooks::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/thredded/view_hooks/config.rb

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config



6
7
8
9
10
11
12
13
# File 'lib/thredded/view_hooks/config.rb', line 6

def initialize
  # @type Array<Proc>
  @before = []
  # @type Array<Proc>
  @replace = []
  # @type Array<Proc>
  @after = []
end

Instance Method Details

#after(&block) ⇒ Array<Proc>

Parameters:

  • block (Proc)

Returns:

  • (Array<Proc>)


31
32
33
34
# File 'lib/thredded/view_hooks/config.rb', line 31

def after(&block)
  @after << block if block
  @after
end

#before(&block) ⇒ Array<Proc>

Parameters:

  • block (Proc)

Returns:

  • (Array<Proc>)


17
18
19
20
# File 'lib/thredded/view_hooks/config.rb', line 17

def before(&block)
  @before << block if block
  @before
end

#replace(&block) ⇒ Array<Proc>

Parameters:

  • block (Proc)

Returns:

  • (Array<Proc>)


24
25
26
27
# File 'lib/thredded/view_hooks/config.rb', line 24

def replace(&block)
  @replace << block if block
  @replace
end