Class: Sevgi::Executor::Source
- Inherits:
-
Data
- Object
- Data
- Sevgi::Executor::Source
- Defined in:
- lib/sevgi/executor/source.rb
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
Instance Method Summary collapse
-
#initialize(string:, file: nil, line: nil) ⇒ Source
constructor
A new instance of Source.
- #key ⇒ Object
Constructor Details
#initialize(string:, file: nil, line: nil) ⇒ Source
Returns a new instance of Source.
10 |
# File 'lib/sevgi/executor/source.rb', line 10 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
5 6 7 |
# File 'lib/sevgi/executor/source.rb', line 5 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line
5 6 7 |
# File 'lib/sevgi/executor/source.rb', line 5 def line @line end |
#string ⇒ Object (readonly)
Returns the value of attribute string
5 6 7 |
# File 'lib/sevgi/executor/source.rb', line 5 def string @string end |
Class Method Details
.call ⇒ Object
6 |
# File 'lib/sevgi/executor/source.rb', line 6 def self.call(...) = new(...) |
.load(file) ⇒ Object
8 |
# File 'lib/sevgi/executor/source.rb', line 8 def self.load(file) = new(string: ::File.read(file), file: file, line: 1) |
Instance Method Details
#key ⇒ Object
12 |
# File 'lib/sevgi/executor/source.rb', line 12 def key = file |