Class: Natsukantou::Setup::Registry
- Inherits:
-
Object
- Object
- Natsukantou::Setup::Registry
- Includes:
- Singleton
- Defined in:
- lib/natsukantou/setup/registry.rb
Instance Attribute Summary collapse
-
#middlewares ⇒ Object
readonly
Returns the value of attribute middlewares.
-
#translators ⇒ Object
readonly
Returns the value of attribute translators.
Instance Method Summary collapse
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #register(type, klass, path) ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
13 14 15 16 |
# File 'lib/natsukantou/setup/registry.rb', line 13 def initialize @translators = [] @middlewares = [] end |
Instance Attribute Details
#middlewares ⇒ Object (readonly)
Returns the value of attribute middlewares.
11 12 13 |
# File 'lib/natsukantou/setup/registry.rb', line 11 def middlewares @middlewares end |
#translators ⇒ Object (readonly)
Returns the value of attribute translators.
10 11 12 |
# File 'lib/natsukantou/setup/registry.rb', line 10 def translators @translators end |
Instance Method Details
#register(type, klass, path) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/natsukantou/setup/registry.rb', line 18 def register(type, klass, path) case type when :translator translators << [klass, path] when :middleware middlewares << [klass, path] end end |