Class: NBTFile::Types::ByteArray
- Inherits:
-
Object
- Object
- NBTFile::Types::ByteArray
- Includes:
- Private::Base
- Defined in:
- lib/nbtfile.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ ByteArray
constructor
A new instance of ByteArray.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(value) ⇒ ByteArray
Returns a new instance of ByteArray.
896 897 898 899 900 901 |
# File 'lib/nbtfile.rb', line 896 def initialize(value) unless value.respond_to? :to_str raise TypeError, "String or string-like expected" end @value = value.to_str end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
894 895 896 |
# File 'lib/nbtfile.rb', line 894 def value @value end |
Instance Method Details
#==(other) ⇒ Object
903 904 905 |
# File 'lib/nbtfile.rb', line 903 def ==(other) self.class == other.class && @value == other.value end |
#to_s ⇒ Object Also known as: to_str
907 |
# File 'lib/nbtfile.rb', line 907 def to_s ; @value.dup ; end |