Class: YARP::Debug::ISeq

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parts) ⇒ ISeq

Returns a new instance of ISeq.



333
334
335
# File 'lib/yarp.rb', line 333

def initialize(parts)
  @parts = parts
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



331
332
333
# File 'lib/yarp.rb', line 331

def parts
  @parts
end

Instance Method Details

#each_childObject



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/yarp.rb', line 349

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



345
346
347
# File 'lib/yarp.rb', line 345

def instructions
  parts[13]
end

#local_tableObject



341
342
343
# File 'lib/yarp.rb', line 341

def local_table
  parts[10]
end

#typeObject



337
338
339
# File 'lib/yarp.rb', line 337

def type
  parts[0]
end