Class: Prism::Debug::ISeq

Inherits:
Object
  • Object
show all
Defined in:
lib/prism/debug.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#partsObject (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_childObject



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

#instructionsObject



22
23
24
# File 'lib/prism/debug.rb', line 22

def instructions
  parts[13]
end

#local_tableObject



18
19
20
# File 'lib/prism/debug.rb', line 18

def local_table
  parts[10]
end

#typeObject



14
15
16
# File 'lib/prism/debug.rb', line 14

def type
  parts[0]
end