Class: Prism::Debug::ISeq
- Inherits:
-
Object
- Object
- Prism::Debug::ISeq
- Defined in:
- lib/prism/debug.rb
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
Instance Method Summary collapse
- #each_child ⇒ Object
-
#initialize(parts) ⇒ ISeq
constructor
A new instance of ISeq.
- #instructions ⇒ Object
- #local_table ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(parts) ⇒ ISeq
Returns a new instance of ISeq.
10 11 12 |
# File 'lib/prism/debug.rb', line 10 def initialize(parts) @parts = parts end |
Instance Attribute Details
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
8 9 10 |
# File 'lib/prism/debug.rb', line 8 def parts @parts end |
Instance Method Details
#each_child ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/prism/debug.rb', line 26 def each_child instructions.each do |instruction| # Only look at arrays. Other instructions are line numbers or # tracepoint events. next unless instruction.is_a?(Array) instruction.each do |opnd| # Only look at arrays. Other operands are literals. next unless opnd.is_a?(Array) # Only look at instruction sequences. Other operands are literals. next unless opnd[0] == "YARVInstructionSequence/SimpleDataFormat" yield ISeq.new(opnd) end end end |
#instructions ⇒ Object
22 23 24 |
# File 'lib/prism/debug.rb', line 22 def instructions parts[13] end |
#local_table ⇒ Object
18 19 20 |
# File 'lib/prism/debug.rb', line 18 def local_table parts[10] end |
#type ⇒ Object
14 15 16 |
# File 'lib/prism/debug.rb', line 14 def type parts[0] end |