Class: TraceTree::Point::Loader
- Inherits:
-
Object
- Object
- TraceTree::Point::Loader
- Defined in:
- lib/trace_tree/point.rb
Instance Attribute Summary collapse
-
#point_classes ⇒ Object
readonly
Returns the value of attribute point_classes.
Instance Method Summary collapse
- #create(point) ⇒ Object
-
#initialize(*enhancement) ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(*enhancement) ⇒ Loader
Returns a new instance of Loader.
192 193 194 195 196 197 |
# File 'lib/trace_tree/point.rb', line 192 def initialize *enhancement return @point_classes = Point.classes if enhancement.empty? @point_classes = Point.classes.each_with_object(Point.classes.dup) do |entry, hash| hash[entry[0]] = entry[1].clone.prepend *enhancement end end |
Instance Attribute Details
#point_classes ⇒ Object (readonly)
Returns the value of attribute point_classes.
190 191 192 |
# File 'lib/trace_tree/point.rb', line 190 def point_classes @point_classes end |
Instance Method Details
#create(point) ⇒ Object
199 200 201 202 |
# File 'lib/trace_tree/point.rb', line 199 def create point point_klass = point_classes[[point.event, point.defined_class, point.method_id]] point_klass.new point end |