Class: Sonar::Connector::ExecutionContext

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

Overview

Command execution context, whereby commands can be injected with consumer context variables for the logger and status objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ ExecutionContext

Returns a new instance of ExecutionContext.



11
12
13
14
15
16
17
18
# File 'lib/sonar_connector/consumer.rb', line 11

def initialize(params)
  @log = params[:log]
  @status = params[:status]
  
  # pass the controller all the way from the consumer initialisation into the command execution context,
  # so that we can call privileged methods such as shutdown.
  @controller = params[:controller]
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



9
10
11
# File 'lib/sonar_connector/consumer.rb', line 9

def controller
  @controller
end

#logObject (readonly)

Returns the value of attribute log.



7
8
9
# File 'lib/sonar_connector/consumer.rb', line 7

def log
  @log
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/sonar_connector/consumer.rb', line 8

def status
  @status
end