Class: Camunda::Model

Inherits:
Spyke::Base
  • Object
show all
Defined in:
lib/camunda/model.rb

Overview

This class in the main element of Spyke. It defines which API models will be bound to.

Defined Under Namespace

Classes: RecordNotFound

Class Method Summary collapse

Class Method Details

.base_pathObject



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

Parameters:

  • params (Hash)

    query parameters

Returns:

Raises:



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_idString

Note:

default worker id is set in Camunda::Workflow.configuration

Returns the worker id

Returns:

  • (String)

    id of worker



17
18
19
# File 'lib/camunda/model.rb', line 17

def self.worker_id
  Camunda::Workflow.configuration.worker_id
end