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.



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