Class: TraceTree::Point::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/trace_tree/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_classesObject (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