Class: Camunda::Model
- Inherits:
-
Spyke::Base
- Object
- Spyke::Base
- Camunda::Model
- Defined in:
- lib/camunda/model.rb
Overview
This class in the main element of Spyke. It defines which API models will be bound to.
Direct Known Subclasses
Deployment, ExternalTask, Incident, ProcessDefinition, ProcessInstance, Signal, Task
Defined Under Namespace
Classes: RecordNotFound
Class Method Summary collapse
- .base_path ⇒ Object
-
.find_by!(params) ⇒ Camunda::Model
Returns result of find_by but raises an exception instead of returning nil.
-
.worker_id ⇒ String
Returns the worker id.
Class Method Details
.base_path ⇒ Object
21 22 23 |
# File 'lib/camunda/model.rb', line 21 def self.base_path uri.sub("(:id)", '') end |
.find_by!(params) ⇒ Camunda::Model
Returns result of find_by but raises an exception instead of returning nil
8 9 10 11 12 |
# File 'lib/camunda/model.rb', line 8 def self.find_by!(params) with(base_path).where(params).first.tap do |result| raise Camunda::Model::RecordNotFound unless result end end |
.worker_id ⇒ String
Note:
default worker id is set in Camunda::Workflow.configuration
Returns the worker id
17 18 19 |
# File 'lib/camunda/model.rb', line 17 def self.worker_id Camunda::Workflow.configuration.worker_id end |