Class: XfOOrth::StringSource
- Inherits:
-
AbstractSource
- Object
- AbstractSource
- XfOOrth::StringSource
- Defined in:
- lib/fOOrth/compiler/source/string_source.rb
Overview
The StringSource class used to extract fOOrth source code from a string.
Instance Attribute Summary
Attributes included from ReadPoint
Instance Method Summary collapse
-
#initialize(string) ⇒ StringSource
constructor
Initialize from a string.
-
#source_name ⇒ Object
(also: #file_name)
What is the source of this text?.
Methods inherited from AbstractSource
Methods included from ReadPoint
#eoln?, #read, #reset_read_point
Constructor Details
#initialize(string) ⇒ StringSource
Initialize from a string.
Parameters:
-
string - A string of fOOrth source code.
13 14 15 16 17 |
# File 'lib/fOOrth/compiler/source/string_source.rb', line 13 def initialize(string) @string_list = string.split("\n") @read_step = @string_list.each super() end |
Instance Method Details
#source_name ⇒ Object Also known as: file_name
What is the source of this text?
20 21 22 |
# File 'lib/fOOrth/compiler/source/string_source.rb', line 20 def source_name "A string." end |