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.



427
428
429
# File 'lib/yarp.rb', line 427

def initialize(parts)
  @parts = parts
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



425
426
427
# File 'lib/yarp.rb', line 425

def parts
  @parts
end

Instance Method Details

#each_childObject



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/yarp.rb', line 443

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



439
440
441
# File 'lib/yarp.rb', line 439

def instructions
  parts[13]
end

#local_tableObject



435
436
437
# File 'lib/yarp.rb', line 435

def local_table
  parts[10]
end

#typeObject



431
432
433
# File 'lib/yarp.rb', line 431

def type
  parts[0]
end