Class: Thredded::ViewHooks::Config
- Inherits:
-
Object
- Object
- Thredded::ViewHooks::Config
- Defined in:
- lib/thredded/view_hooks/config.rb
Instance Method Summary collapse
- #after(&block) ⇒ Array<Proc>
- #before(&block) ⇒ Array<Proc>
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #replace(&block) ⇒ Array<Proc>
Constructor Details
#initialize ⇒ Config
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>
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>
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>
24 25 26 27 |
# File 'lib/thredded/view_hooks/config.rb', line 24 def replace(&block) @replace << block if block @replace end |