Class: Slidr::Commands::ReturnExecutor

Inherits:
BaseExecutor show all
Defined in:
lib/slidr/commands/return_executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ ReturnExecutor

Returns a new instance of ReturnExecutor.



6
7
8
9
# File 'lib/slidr/commands/return_executor.rb', line 6

def initialize(content)
  @content = content
  @commands = []
end

Instance Method Details

#add(command) ⇒ Object



11
12
13
14
# File 'lib/slidr/commands/return_executor.rb', line 11

def add(command)
  @commands << command
  self
end

#goObject



16
17
18
19
20
# File 'lib/slidr/commands/return_executor.rb', line 16

def go
  @commands.each do |command|
    @content = command.go(@content)
  end
end