Class: Zenaton::Query::Builder
- Inherits:
-
Object
- Object
- Zenaton::Query::Builder
- Defined in:
- lib/zenaton/query/builder.rb
Overview
Wrapper class around the client to interact with workflows by id
Instance Method Summary collapse
-
#find ⇒ Zenaton::Interfaces::Workflow
Finds a workflow.
-
#initialize(klass) ⇒ Builder
constructor
A new instance of Builder.
-
#kill ⇒ Zenaton::Query::Builder
Stops a workflow.
-
#pause ⇒ Zenaton::Query::Builder
Pauses a workflow.
-
#resume ⇒ Zenaton::Query::Builder
Resumes a workflow.
-
#send_event(event) ⇒ Zenaton::Query::Builder
Sends an event to a workflow.
-
#where_id(id) ⇒ Zenaton::Query::Builder
Sets the id of the workflow we want to find.
Constructor Details
Instance Method Details
#find ⇒ Zenaton::Interfaces::Workflow
Finds a workflow
28 29 30 |
# File 'lib/zenaton/query/builder.rb', line 28 def find @client.find_workflow(@klass.to_s, @id) end |
#kill ⇒ Zenaton::Query::Builder
Stops a workflow
42 43 44 45 |
# File 'lib/zenaton/query/builder.rb', line 42 def kill @client.kill_workflow(@klass.to_s, @id) self end |
#pause ⇒ Zenaton::Query::Builder
Pauses a workflow
49 50 51 52 |
# File 'lib/zenaton/query/builder.rb', line 49 def pause @client.pause_workflow(@klass.to_s, @id) self end |
#resume ⇒ Zenaton::Query::Builder
Resumes a workflow
56 57 58 59 |
# File 'lib/zenaton/query/builder.rb', line 56 def resume @client.resume_workflow(@klass.to_s, @id) self end |
#send_event(event) ⇒ Zenaton::Query::Builder
Sends an event to a workflow
35 36 37 38 |
# File 'lib/zenaton/query/builder.rb', line 35 def send_event(event) @client.send_event(@klass.to_s, @id, event) self end |
#where_id(id) ⇒ Zenaton::Query::Builder
Sets the id of the workflow we want to find
21 22 23 24 |
# File 'lib/zenaton/query/builder.rb', line 21 def where_id(id) @id = id self end |