class ActiveProjection::ProjectionTypeRegistry

Public Class Methods

projections() click to toggle source

@return an enumerable with all projections

# File lib/active_projection/projection_type_registry.rb, line 16
def self.projections
  instance.projections.each
end
register(projection) click to toggle source

register a new projection class

The best way to create a new projection is using the ProjectionType module This module automatically registers each class

# File lib/active_projection/projection_type_registry.rb, line 11
def self.register(projection)
  registry << projection
end

Public Instance Methods

projections() click to toggle source
# 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