Class: Kirei::Controller
- Inherits:
-
Routing::Base
- Object
- Routing::Base
- Kirei::Controller
- Extended by:
- T::Sig
- Defined in:
- lib/kirei/controller.rb
Constant Summary
Constants inherited from Routing::Base
Class Attribute Summary collapse
-
.after_hooks ⇒ Object
readonly
Returns the value of attribute after_hooks.
-
.before_hooks ⇒ Object
readonly
Returns the value of attribute before_hooks.
Attributes inherited from Routing::Base
Class Method Summary collapse
Methods inherited from Routing::Base
#add_cors_headers, #call, #default_headers, #initialize, #render
Constructor Details
This class inherits a constructor from Kirei::Routing::Base
Class Attribute Details
.after_hooks ⇒ Object (readonly)
Returns the value of attribute after_hooks.
10 11 12 |
# File 'lib/kirei/controller.rb', line 10 def after_hooks @after_hooks end |
.before_hooks ⇒ Object (readonly)
Returns the value of attribute before_hooks.
10 11 12 |
# File 'lib/kirei/controller.rb', line 10 def before_hooks @before_hooks end |
Class Method Details
.after(&block) ⇒ Object
39 40 41 42 |
# File 'lib/kirei/controller.rb', line 39 def self.after(&block) @after_hooks ||= T.let(Set.new, Routing::NilableHooksType) @after_hooks.add(block) if block end |
.before(&block) ⇒ Object
26 27 28 29 |
# File 'lib/kirei/controller.rb', line 26 def self.before(&block) @before_hooks ||= T.let(Set.new, Routing::NilableHooksType) @before_hooks.add(block) if block end |