Class: TTM::Memory
- Inherits:
-
Object
- Object
- TTM::Memory
- Defined in:
- lib/tatum.rb
Overview
TTM::Memory
Instance Attribute Summary collapse
-
#str ⇒ Array
readonly
Returns the array used to store output strings.
Instance Method Summary collapse
-
#clear ⇒ Object
Resets @str to an empty string.
-
#initialize(p_path) ⇒ Memory
constructor
Initializes the Memory object.
-
#puts(str) ⇒ Object
Adds a string to @strs.
-
#to_s ⇒ String
Returns the string that is stored in memory.
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
#str ⇒ Array (readonly)
Returns the array used to store output strings. You probably don’t need this method for anything; it’s just handy for debugging.
863 864 865 |
# File 'lib/tatum.rb', line 863 def str @str end |
Instance Method Details
#clear ⇒ Object
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.
874 875 876 |
# File 'lib/tatum.rb', line 874 def puts(str) @str += str + "\n" end |
#to_s ⇒ String
Returns the string that is stored in memory.
880 881 882 |
# File 'lib/tatum.rb', line 880 def to_s return @str end |