Class: StackProf::Report::StackCursor
- Inherits:
-
Struct
- Object
- Struct
- StackProf::Report::StackCursor
- Defined in:
- lib/stackprof/report.rb
Instance Attribute Summary collapse
-
#idx ⇒ Object
Returns the value of attribute idx.
-
#length ⇒ Object
Returns the value of attribute length.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
Instance Attribute Details
#idx ⇒ Object
Returns the value of attribute idx
98 99 100 |
# File 'lib/stackprof/report.rb', line 98 def idx @idx end |
#length ⇒ Object
Returns the value of attribute length
98 99 100 |
# File 'lib/stackprof/report.rb', line 98 def length @length end |
#raw ⇒ Object
Returns the value of attribute raw
98 99 100 |
# File 'lib/stackprof/report.rb', line 98 def raw @raw end |
Instance Method Details
#<=>(other) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/stackprof/report.rb', line 111 def <=>(other) i = 0 while i < length && i < other.length if self[i] != other[i] return self[i] <=> other[i] end i += 1 end return length <=> other.length end |
#[](i) ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/stackprof/report.rb', line 103 def [](i) if i >= length nil else raw[1 + idx + i] end end |
#weight ⇒ Object
99 100 101 |
# File 'lib/stackprof/report.rb', line 99 def weight @weight ||= raw[1 + idx + length] end |