class StringBuffer

The StringBuffer class is the mutable variant of the String class.

Public Class Methods

create_foorth_instance(vm) click to toggle source

Create an instance of StringBuffer.
Parameters:

  • vm - The current fOOrth virtual machine.

# File lib/fOOrth/monkey_patch/string.rb, line 103
def self.create_foorth_instance(vm)
  (obj = self.new).foorth_init(vm)
  obj
end
new(text="") click to toggle source

Create a string buffer from an object. Make sure that object is a string and make sure that string is not frozen.

Calls superclass method
# File lib/fOOrth/monkey_patch/string.rb, line 81
def initialize(text="")
  super(text)
end

Public Instance Methods

foorth_string_freeze() click to toggle source

Freeze only pure strings

# File lib/fOOrth/monkey_patch/string.rb, line 96
def foorth_string_freeze
  self
end
full_clone(_arg=nil) click to toggle source

A special patch for full_clone

# File lib/fOOrth/monkey_patch/string.rb, line 91
def full_clone(_arg=nil)
  self.clone
end
safe_clone() click to toggle source

A special patch for safe_clone

# File lib/fOOrth/monkey_patch/string.rb, line 86
def safe_clone
  self.clone
end