Class: SetUp::BaseTraceSetUp
- Inherits:
-
Object
- Object
- SetUp::BaseTraceSetUp
- Defined in:
- lib/xray_method_tracer/set_up/base_trace_set_up.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base_klasses ⇒ Object
readonly
Returns the value of attribute base_klasses.
-
#klasses ⇒ Object
readonly
Returns the value of attribute klasses.
-
#source_locations ⇒ Object
readonly
Returns the value of attribute source_locations.
Instance Method Summary collapse
- #apply_trace ⇒ Object
-
#initialize(base_klasses, klasses, source_locations) ⇒ BaseTraceSetUp
constructor
A new instance of BaseTraceSetUp.
Constructor Details
#initialize(base_klasses, klasses, source_locations) ⇒ BaseTraceSetUp
Returns a new instance of BaseTraceSetUp.
11 12 13 14 15 |
# File 'lib/xray_method_tracer/set_up/base_trace_set_up.rb', line 11 def initialize(base_klasses, klasses, source_locations) @base_klasses = base_klasses @klasses = klasses @source_locations = source_locations end |
Instance Attribute Details
#base_klasses ⇒ Object (readonly)
Returns the value of attribute base_klasses.
9 10 11 |
# File 'lib/xray_method_tracer/set_up/base_trace_set_up.rb', line 9 def base_klasses @base_klasses end |
#klasses ⇒ Object (readonly)
Returns the value of attribute klasses.
9 10 11 |
# File 'lib/xray_method_tracer/set_up/base_trace_set_up.rb', line 9 def klasses @klasses end |
#source_locations ⇒ Object (readonly)
Returns the value of attribute source_locations.
9 10 11 |
# File 'lib/xray_method_tracer/set_up/base_trace_set_up.rb', line 9 def source_locations @source_locations end |
Instance Method Details
#apply_trace ⇒ Object
17 18 19 20 21 22 |
# File 'lib/xray_method_tracer/set_up/base_trace_set_up.rb', line 17 def apply_trace classes_to_override = (base_klasses + klasses).uniq classes_to_override.each { |klass| override_methods_in_class(klass) } override_methods_in_subclasses if base_klasses.any? end |