Class: Sevgi::Executor::Source Private
- Inherits:
-
Data
- Object
- Data
- Sevgi::Executor::Source
- Defined in:
- lib/sevgi/executor/source.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Describes Ruby source evaluated by the Sevgi executor.
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Class Method Summary collapse
-
.call(string:, file: nil, line: nil) ⇒ Sevgi::Executor::Source
private
Builds a source object.
-
.load(file) ⇒ Sevgi::Executor::Source
private
Builds a source object from a file.
Instance Method Summary collapse
-
#initialize(string:, file: nil, line: nil) ⇒ void
constructor
private
Creates a source object.
-
#key ⇒ String
private
Returns the stack key used for this source.
Constructor Details
#initialize(string:, file: nil, line: nil) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a source object.
27 |
# File 'lib/sevgi/executor/source.rb', line 27 def initialize(string:, file: nil, line: nil) = super(string:, file: file || "sevgi", line: line || 1) |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file
7 8 9 |
# File 'lib/sevgi/executor/source.rb', line 7 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line
7 8 9 |
# File 'lib/sevgi/executor/source.rb', line 7 def line @line end |
#string ⇒ Object (readonly)
Returns the value of attribute string
7 8 9 |
# File 'lib/sevgi/executor/source.rb', line 7 def string @string end |
Class Method Details
.call(string:, file: nil, line: nil) ⇒ Sevgi::Executor::Source
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 |
# File 'lib/sevgi/executor/source.rb', line 14 def self.call(...) = new(...) |
.load(file) ⇒ Sevgi::Executor::Source
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds a source object from a file.
20 |
# File 'lib/sevgi/executor/source.rb', line 20 def self.load(file) = new(string: ::File.read(file), file: file, line: 1) |
Instance Method Details
#key ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the stack key used for this source.
31 |
# File 'lib/sevgi/executor/source.rb', line 31 def key = file |