Class: Tina4::ServiceContext

Inherits:
Object
  • Object
show all
Defined in:
lib/tina4/service_runner.rb

Overview

Context object passed to each service handler, giving it control over its own lifecycle and metadata.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ServiceContext

Returns a new instance of ServiceContext.



9
10
11
12
13
14
# File 'lib/tina4/service_runner.rb', line 9

def initialize(name)
  @running = true
  @last_run = nil
  @name = name
  @error_count = 0
end

Instance Attribute Details

#error_countObject

Returns the value of attribute error_count.



7
8
9
# File 'lib/tina4/service_runner.rb', line 7

def error_count
  @error_count
end

#last_runObject

Returns the value of attribute last_run.



7
8
9
# File 'lib/tina4/service_runner.rb', line 7

def last_run
  @last_run
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/tina4/service_runner.rb', line 7

def name
  @name
end

#runningObject

Returns the value of attribute running.



7
8
9
# File 'lib/tina4/service_runner.rb', line 7

def running
  @running
end