Class: Dtrace::StackRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/dtrace/stackrecord.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21
22
23
# File 'lib/dtrace/stackrecord.rb', line 21

def value
  @value
end

Instance Method Details

#parse(raw) ⇒ Object

Given a stack as a string returned from DTrace, set the value of this record to a list of stack frames.



25
26
27
28
# File 'lib/dtrace/stackrecord.rb', line 25

def parse(raw)
  frames = raw.split(/\n/)
  @value = frames.map {|f| f.lstrip }.select {|f| f.length > 0 }
end