Class: Sonar::Connector::IncrementStatusValueCommand
- Defined in:
- lib/sonar_connector/commands/increment_status_value_command.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(connector, field, value = 1) ⇒ IncrementStatusValueCommand
constructor
A new instance of IncrementStatusValueCommand.
Methods inherited from Command
Constructor Details
#initialize(connector, field, value = 1) ⇒ IncrementStatusValueCommand
Returns a new instance of IncrementStatusValueCommand.
5 6 7 8 9 10 11 |
# File 'lib/sonar_connector/commands/increment_status_value_command.rb', line 5 def initialize(connector, field, value = 1) l = lambda do current = status[connector.name] ? status[connector.name][field].to_i : 0 status.set connector.name, field, current+value end super(l) end |