Class: Qs::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/qs/runner.rb

Direct Known Subclasses

QsRunner, TestRunner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handler_class, args = nil) ⇒ Runner

Returns a new instance of Runner.



10
11
12
13
14
15
16
17
18
# File 'lib/qs/runner.rb', line 10

def initialize(handler_class, args = nil)
  args ||= {}
  @logger  = args[:logger] || Qs::NullLogger.new
  @message = args[:message]
  @params  = args[:params] || {}

  @handler_class = handler_class
  @handler = @handler_class.new(self)
end

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



7
8
9
# File 'lib/qs/runner.rb', line 7

def handler
  @handler
end

#handler_classObject (readonly)

Returns the value of attribute handler_class.



7
8
9
# File 'lib/qs/runner.rb', line 7

def handler_class
  @handler_class
end

#loggerObject (readonly)

Returns the value of attribute logger.



8
9
10
# File 'lib/qs/runner.rb', line 8

def logger
  @logger
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/qs/runner.rb', line 8

def message
  @message
end

#paramsObject (readonly)

Returns the value of attribute params.



8
9
10
# File 'lib/qs/runner.rb', line 8

def params
  @params
end

Instance Method Details

#haltObject



24
25
26
# File 'lib/qs/runner.rb', line 24

def halt
  throw :halt
end

#runObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/qs/runner.rb', line 20

def run
  raise NotImplementedError
end