Class: TraceViz::TraceData::TracePoint::Base

Inherits:
Node
  • Object
show all
Includes:
TraceViz::Traits::Identifiable
Defined in:
lib/trace_viz/trace_data/trace_point/base.rb

Direct Known Subclasses

MethodCall, MethodReturn

Instance Attribute Summary collapse

Attributes included from TraceViz::Traits::Identifiable

#action_id, #id

Attributes inherited from Node

#children, #parent

Attributes included from TraceViz::Traits::TimeTrackable

#timestamp

Attributes included from TraceViz::Traits::DepthTrackable

#depth

Instance Method Summary collapse

Methods included from TraceViz::Traits::Identifiable

#assign_ids

Methods inherited from Node

#add_child, #add_children

Methods included from TraceViz::Traits::TimeTrackable

#record_timestamp

Methods included from TraceViz::Traits::DepthTrackable

#assign_depth

Methods included from Helpers::ConfigHelper

#config, #fetch_general_config

Constructor Details

#initialize(trace_point) ⇒ Base

Returns a new instance of Base.



20
21
22
23
24
25
26
27
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 20

def initialize(trace_point)
  super()

  @trace_point = trace_point
  populate_attributes
  assign_memory_id
  assign_ids
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def action
  @action
end

#eventObject (readonly)

Returns the value of attribute event.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def event
  @event
end

#klassObject (readonly)

Returns the value of attribute klass.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def klass
  @klass
end

#line_numberObject (readonly)

Returns the value of attribute line_number.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def line_number
  @line_number
end

#memory_idObject (readonly)

Returns the value of attribute memory_id.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def memory_id
  @memory_id
end

#pathObject (readonly)

Returns the value of attribute path.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def path
  @path
end

#trace_pointObject (readonly)

Returns the value of attribute trace_point.



12
13
14
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 12

def trace_point
  @trace_point
end

Instance Method Details

#durationObject



33
34
35
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 33

def duration
  0
end

#keyObject



29
30
31
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 29

def key
  event
end

#to_hObject



37
38
39
40
41
42
43
44
45
# File 'lib/trace_viz/trace_data/trace_point/base.rb', line 37

def to_h
  super.merge(
    {
      id: id,
      action_id: action_id,
      memory_id: memory_id,
    },
  )
end