Class: TurboTest::ConstantTracer::Constructor
- Inherits:
-
Object
- Object
- TurboTest::ConstantTracer::Constructor
- Defined in:
- lib/turbo_test_constant_tracer/constructor.rb
Instance Method Summary collapse
- #construct ⇒ Object
-
#initialize(original_class) ⇒ Constructor
constructor
A new instance of Constructor.
Constructor Details
#initialize(original_class) ⇒ Constructor
Returns a new instance of Constructor.
6 7 8 9 |
# File 'lib/turbo_test_constant_tracer/constructor.rb', line 6 def initialize(original_class) @klass = original_class @klass_name = original_class.name.gsub("::", "") end |
Instance Method Details
#construct ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/turbo_test_constant_tracer/constructor.rb', line 11 def construct return ProxyKlass.const_get(@klass_name) if proxy_class_defined? Klass.define(@klass, @klass_name).tap do prepend_equality_operators_to_original_class prepend_equality_operators Numeric prepend_equality_operators Comparable end end |