Class: JvmBytecode::Constants::Constant
- Inherits:
-
Object
- Object
- JvmBytecode::Constants::Constant
show all
- Defined in:
- lib/jvm_bytecode/constants/constant.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.tag ⇒ Object
Returns the value of attribute tag.
5
6
7
|
# File 'lib/jvm_bytecode/constants/constant.rb', line 5
def tag
@tag
end
|
Class Method Details
.define(t) ⇒ Object
7
8
9
10
11
12
|
# File 'lib/jvm_bytecode/constants/constant.rb', line 7
def define(t)
@@constants ||= {}
@@constants[t] = self
@tag = t
end
|
.fetch(t) ⇒ Object
14
15
16
|
# File 'lib/jvm_bytecode/constants/constant.rb', line 14
def fetch(t)
@@constants[t] || raise(Errors::ConstantError, "Constant:#{t} is not implemented")
end
|
Instance Method Details
#additional_bytecode ⇒ Object
23
24
25
|
# File 'lib/jvm_bytecode/constants/constant.rb', line 23
def additional_bytecode
''
end
|
#bytecode ⇒ Object
19
20
21
|
# File 'lib/jvm_bytecode/constants/constant.rb', line 19
def bytecode
[self.class.tag].pack('C') + additional_bytecode
end
|