Class: ListExecutor
- Inherits:
-
Object
- Object
- ListExecutor
- Defined in:
- lib/rubyslim/list_executor.rb
Instance Method Summary collapse
- #execute(instructions) ⇒ Object
-
#initialize ⇒ ListExecutor
constructor
A new instance of ListExecutor.
Constructor Details
#initialize ⇒ ListExecutor
Returns a new instance of ListExecutor.
6 7 8 |
# File 'lib/rubyslim/list_executor.rb', line 6 def initialize() @executor = StatementExecutor.new end |
Instance Method Details
#execute(instructions) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rubyslim/list_executor.rb', line 10 def execute(instructions) results = [] instructions.each do |instruction| result = Statement.execute(instruction, @executor) results << result if result[1] =~ /^STOP/ return results end end return results end |