Class: Sonar::Connector::Command
- Inherits:
-
Object
- Object
- Sonar::Connector::Command
- Defined in:
- lib/sonar_connector/commands/command.rb
Overview
Base command class that all commands should subclass.
Direct Known Subclasses
CommitSeppukuCommand, IncrementStatusValueCommand, SendAdminEmailCommand, UpdateDiskUsageCommand, UpdateStatusCommand
Instance Attribute Summary collapse
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
- #execute(context = nil) ⇒ Object
-
#initialize(proc) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(proc) ⇒ Command
Returns a new instance of Command.
11 12 13 |
# File 'lib/sonar_connector/commands/command.rb', line 11 def initialize(proc) @proc = proc end |
Instance Attribute Details
#proc ⇒ Object
Returns the value of attribute proc.
9 10 11 |
# File 'lib/sonar_connector/commands/command.rb', line 9 def proc @proc end |
Instance Method Details
#execute(context = nil) ⇒ Object
15 16 17 |
# File 'lib/sonar_connector/commands/command.rb', line 15 def execute(context = nil) context.instance_eval(&@proc) end |