Class: Nobbie::Wx::Command::Executor
- Inherits:
-
Object
- Object
- Nobbie::Wx::Command::Executor
- Defined in:
- lib/nobbie/wx/command/executor.rb
Overview
:nodoc:
Class Method Summary collapse
Instance Method Summary collapse
- #execute(command) ⇒ Object
-
#initialize(reporter = Reporter.new) ⇒ Executor
constructor
A new instance of Executor.
- #reporter=(reporter) ⇒ Object
Constructor Details
Class Method Details
.execute(command) ⇒ Object
10 11 12 |
# File 'lib/nobbie/wx/command/executor.rb', line 10 def self.execute(command) executor.execute(command) end |
.executor ⇒ Object
14 15 16 |
# File 'lib/nobbie/wx/command/executor.rb', line 14 def self.executor @executor ||= new end |
.reporter=(reporter) ⇒ Object
18 19 20 |
# File 'lib/nobbie/wx/command/executor.rb', line 18 def self.reporter= reporter executor.reporter = reporter end |
Instance Method Details
#execute(command) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/nobbie/wx/command/executor.rb', line 26 def execute(command) @reporter.before_executing_command(command) result = command.execute @reporter.after_executing_command(result) result end |
#reporter=(reporter) ⇒ Object
33 34 35 |
# File 'lib/nobbie/wx/command/executor.rb', line 33 def reporter= reporter @reporter = reporter end |