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
-
#file_name ⇒ Object
A string source has no file name to return.
-
#initialize(string) ⇒ StringSource
constructor
Initialize from a string.
-
#source_name ⇒ Object
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
#file_name ⇒ Object
A string source has no file name to return.
25 26 27 |
# File 'lib/fOOrth/compiler/source/string_source.rb', line 25 def file_name nil end |
#source_name ⇒ Object
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 |