Class: ActiveProjection::ProjectionTypeRegistry
- Inherits:
-
Object
- Object
- ActiveProjection::ProjectionTypeRegistry
- Includes:
- Singleton
- Defined in:
- lib/active_projection/projection_type_registry.rb
Class Method Summary collapse
-
.projections ⇒ Object
An enumerable with all projections.
-
.register(projection) ⇒ Object
register a new projection class.
Instance Method Summary collapse
Class Method Details
.projections ⇒ Object
Returns an enumerable with all projections.
16 17 18 |
# File 'lib/active_projection/projection_type_registry.rb', line 16 def self.projections instance.projections.each end |
.register(projection) ⇒ Object
register a new projection class
The best way to create a new projection is using the ProjectionType module This module automatically registers each class
11 12 13 |
# File 'lib/active_projection/projection_type_registry.rb', line 11 def self.register(projection) self.registry << projection end |
Instance Method Details
#projections ⇒ Object
20 21 22 |
# File 'lib/active_projection/projection_type_registry.rb', line 20 def projections @projections ||= self.class.registry.freeze.map { |projection_class| projection_class.new }.freeze end |