Module: ClusterFactory

Included in:
Euclidean::Circle, Euclidean::Rectangle
Defined in:
lib/euclidean/cluster_factory.rb

Overview

Include this module in the base class of a class cluster to handle swizzling of ::new

Class Method Summary collapse

Class Method Details

.included(parent) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/euclidean/cluster_factory.rb', line 4

def self.included(parent)
  class << parent
    alias :original_new :new

    def inherited(subclass)
      class << subclass
        alias :new :original_new
      end
    end
  end
end