Class: Sonar::Connector::Command

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

Overview

Base command class that all commands should subclass.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#procObject

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