Class: Sonar::Connector::IncrementStatusValueCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/sonar_connector/commands/increment_status_value_command.rb

Instance Attribute Summary

Attributes inherited from Command

#proc

Instance Method Summary collapse

Methods inherited from Command

#execute

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