Class: JavaClass::ClassFile::Constants::Value
- Defined in:
- lib/javaclass/classfile/constants/value.rb
Overview
Superclass of value constants like ConstantInt
(Integer
) in the constant pool.
- Author
-
Peter Kofler
Direct Known Subclasses
ConstantAsciz, ConstantDouble, ConstantFloat, ConstantInt, ConstantLong
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Base
Instance Method Summary collapse
-
#dump ⇒ Object
Return part of debug output.
-
#initialize(name = self.class.to_s[/::[^:]+$/][10..-1].downcase) ⇒ Value
constructor
Create a constant value with an optional downcase name.
-
#to_s ⇒ Object
Return the value as string.
Constructor Details
#initialize(name = self.class.to_s[/::[^:]+$/][10..-1].downcase) ⇒ Value
Create a constant value with an optional downcase name
14 15 16 |
# File 'lib/javaclass/classfile/constants/value.rb', line 14 def initialize(name=self.class.to_s[/::[^:]+$/][10..-1].downcase) super(name) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
11 12 13 |
# File 'lib/javaclass/classfile/constants/value.rb', line 11 def value @value end |
Instance Method Details
#dump ⇒ Object
Return part of debug output.
24 25 26 |
# File 'lib/javaclass/classfile/constants/value.rb', line 24 def dump super + "#{@value}" end |
#to_s ⇒ Object
Return the value as string.
19 20 21 |
# File 'lib/javaclass/classfile/constants/value.rb', line 19 def to_s @value.to_s end |