Class: NBTFile::Types::String
- Inherits:
-
BaseScalar
- Object
- BaseScalar
- NBTFile::Types::String
- Defined in:
- lib/nbtfile.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ String
constructor
A new instance of String.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(value) ⇒ String
Returns a new instance of String.
880 881 882 883 884 885 |
# File 'lib/nbtfile.rb', line 880 def initialize(value) unless value.respond_to? :to_str raise TypeError, "String or string-like expected" end @value = value.to_str end |
Instance Method Details
#to_s ⇒ Object Also known as: to_str
887 |
# File 'lib/nbtfile.rb', line 887 def to_s ; @value.dup ; end |