Class: Eceval::EvaluationContext
- Inherits:
-
Object
- Object
- Eceval::EvaluationContext
- Defined in:
- lib/eceval.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
Instance Method Summary collapse
-
#initialize(filename:, lineno: 1) ⇒ EvaluationContext
constructor
A new instance of EvaluationContext.
- #process_line(line) ⇒ Object
Constructor Details
#initialize(filename:, lineno: 1) ⇒ EvaluationContext
Returns a new instance of EvaluationContext.
26 27 28 29 30 31 |
# File 'lib/eceval.rb', line 26 def initialize(filename:, lineno: 1) @filename = filename @lineno = lineno @lines_consumed = 0 @chunk = nil end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
24 25 26 |
# File 'lib/eceval.rb', line 24 def filename @filename end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
24 25 26 |
# File 'lib/eceval.rb', line 24 def lineno @lineno end |
Instance Method Details
#process_line(line) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/eceval.rb', line 33 def process_line(line) if @chunk process_code_line(line) else process_noncode_line(line) end ensure @lines_consumed += 1 end |