Class: ActiveProjection::ProjectionTypeRegistry

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/active_projection/projection_type_registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.projectionsObject

Returns an enumerable with all projections.

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

#projectionsObject



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