Class: Kirei::Controller

Inherits:
Routing::Base show all
Extended by:
T::Sig
Defined in:
lib/kirei/controller.rb

Constant Summary

Constants inherited from Routing::Base

Routing::Base::NOT_FOUND

Class Attribute Summary collapse

Attributes inherited from Routing::Base

#params

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_hooksObject (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_hooksObject (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