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.
149 150 151 152 153 154 |
# File 'lib/trace_tree/point.rb', line 149 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.
147 148 149 |
# File 'lib/trace_tree/point.rb', line 147 def point_classes @point_classes end |
Instance Method Details
#create(point) ⇒ Object
156 157 158 159 |
# File 'lib/trace_tree/point.rb', line 156 def create point point_klass = point_classes[[point.event, point.defined_class, point.method_id]] point_klass.new point end |