class JvmBytecode::Constants::Ref

Attributes

class_index[R]
name_and_type_index[R]

Public Class Methods

decode(io) click to toggle source
# File lib/jvm_bytecode/constants/ref.rb, line 6
def self.decode(io)
  indexes = io.read(4).unpack('S>2')
  new(*indexes)
end
new(class_index, name_and_type_index) click to toggle source
# File lib/jvm_bytecode/constants/ref.rb, line 11
def initialize(class_index, name_and_type_index)
  @class_index = class_index
  @name_and_type_index = name_and_type_index
end

Public Instance Methods

additional_bytecode() click to toggle source
# File lib/jvm_bytecode/constants/ref.rb, line 16
def additional_bytecode
  [@class_index, @name_and_type_index].pack('S>2')
end
to_hash() click to toggle source
# File lib/jvm_bytecode/constants/ref.rb, line 20
def to_hash
  {
    class_index: @class_index,
    name_and_type_index: @name_and_type_index
  }
end