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.
- #sort_bases ⇒ Object
Constructor Details
#initialize(*enhancement, config) ⇒ Loader
Returns a new instance of Loader.
191 192 193 194 195 196 |
# File 'lib/trace_tree/point.rb', line 191 def initialize *enhancement, config @config = config @bases = Point.bases @bases = @bases.map{ |b| b = b.clone; b.prepend *enhancement; b } unless enhancement.empty? sort_bases end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
189 190 191 |
# File 'lib/trace_tree/point.rb', line 189 def config @config end |
#point_classes ⇒ Object (readonly)
Returns the value of attribute point_classes.
189 190 191 |
# File 'lib/trace_tree/point.rb', line 189 def point_classes @point_classes end |
Instance Method Details
#create(point) ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/trace_tree/point.rb', line 211 def create point point_klass = if events = @methods[point.method_id] if klasses = events[point.event] klasses[point.defined_class] || @common else @common end else @common end poi = point_klass.new point poi.config = config poi end |
#sort_bases ⇒ Object
198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/trace_tree/point.rb', line 198 def sort_bases @methods = {} @bases.each do |b| event, klass, method = b.event_class_method events = (@methods[method] ||= {}) klasses = (events[event] ||= {}) klasses[klass] = b end @common = @methods[nil][:common][nil] end |