Class: Command::BasicCommand Abstract
- Inherits:
-
Object
- Object
- Command::BasicCommand
- Defined in:
- lib/command/basic_command.rb
Overview
This class is abstract.
Subclass and override #exec to implement.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
protected
This attribute is the logger.
-
#receiver ⇒ Object
protected
This attribute is the receiver, which will receive executed command.
Instance Method Summary collapse
-
#exec ⇒ Object
The execution of the command.
-
#initialize(receiver, logger = nil) ⇒ BasicCommand
constructor
private
Default constructor.
Constructor Details
#initialize(receiver, logger = nil) ⇒ BasicCommand (private)
Default constructor.
28 29 30 31 32 33 |
# File 'lib/command/basic_command.rb', line 28 def initialize(receiver, logger = nil) @receiver = receiver @logger = logger @logger = Common::CloudboxLoggerMock.new if @logger.nil? @logger.info("Command::BasicCommand initialize the parameters...") end |
Instance Attribute Details
#logger ⇒ Object (protected)
This attribute is the logger.
16 17 18 |
# File 'lib/command/basic_command.rb', line 16 def logger @logger end |
#receiver ⇒ Object (protected)
This attribute is the receiver, which will receive executed command.
14 15 16 |
# File 'lib/command/basic_command.rb', line 14 def receiver @receiver end |
Instance Method Details
#exec ⇒ Object
Note:
This method has to be overrided by the inheriting class.
The execution of the command.
40 41 42 |
# File 'lib/command/basic_command.rb', line 40 def exec() raise NotImplementedError end |