Class: TTM::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/tatum.rb

Overview

TTM::Memory

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p_path) ⇒ Memory

Initializes the Memory object. Doesn’t actually do anything with the p_path param, but sending that param is the standard for any class that can be used with TTM.io.



868
869
870
# File 'lib/tatum.rb', line 868

def initialize(p_path)
	clear()
end

Instance Attribute Details

#strArray (readonly)

Returns the array used to store output strings. You probably don’t need this method for anything; it’s just handy for debugging.

Returns:

  • (Array)


863
864
865
# File 'lib/tatum.rb', line 863

def str
  @str
end

Instance Method Details

#clearObject

Resets @str to an empty string.



885
886
887
# File 'lib/tatum.rb', line 885

def clear
	@str = ''
end

#puts(str) ⇒ Object

Adds a string to @strs.

Parameters:

  • str (String)


874
875
876
# File 'lib/tatum.rb', line 874

def puts(str)
	@str += str + "\n"
end

#to_sString

Returns the string that is stored in memory.

Returns:

  • (String)


880
881
882
# File 'lib/tatum.rb', line 880

def to_s
	return @str
end