Class: TraceTree::Point::Loader
- Inherits:
-
Object
- Object
- TraceTree::Point::Loader
- Defined in:
- lib/trace_tree/point.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#point_classes ⇒ Object
readonly
Returns the value of attribute point_classes.
Instance Method Summary collapse
- #create(point) ⇒ Object
-
#initialize(*enhancement, config) ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(*enhancement, config) ⇒ Loader
Returns a new instance of Loader.
195 196 197 198 199 200 201 |
# File 'lib/trace_tree/point.rb', line 195 def initialize *enhancement, config @config = config 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
#config ⇒ Object (readonly)
Returns the value of attribute config.
193 194 195 |
# File 'lib/trace_tree/point.rb', line 193 def config @config end |
#point_classes ⇒ Object (readonly)
Returns the value of attribute point_classes.
193 194 195 |
# File 'lib/trace_tree/point.rb', line 193 def point_classes @point_classes end |
Instance Method Details
#create(point) ⇒ Object
203 204 205 206 207 208 |
# File 'lib/trace_tree/point.rb', line 203 def create point point_klass = point_classes[[point.event, point.defined_class, point.method_id]] poi = point_klass.new point poi.config = config poi end |