Class: Tempest::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/tempest/cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster, action, respond_to, job_id) ⇒ Context

Returns a new instance of Context.



8
9
10
11
12
13
# File 'lib/tempest/cluster.rb', line 8

def initialize cluster, action, respond_to, job_id
  @action = action
  @respond_to = respond_to
  @job_id = job_id
  @cluster = cluster
end

Instance Attribute Details

#job_idObject (readonly)

Returns the value of attribute job_id.



7
8
9
# File 'lib/tempest/cluster.rb', line 7

def job_id
  @job_id
end

#respond_toObject (readonly)

Returns the value of attribute respond_to.



7
8
9
# File 'lib/tempest/cluster.rb', line 7

def respond_to
  @respond_to
end

Instance Method Details

#answer(*args) ⇒ Object



19
20
21
# File 'lib/tempest/cluster.rb', line 19

def answer *args
  Tempest.client(@respond_to).send @action, @job_id, args.to_json
end

#stopObject



15
16
17
# File 'lib/tempest/cluster.rb', line 15

def stop
  @cluster.loop = false
end