Sha256: 8e254d35811b1440b05ee2df687b779422c32bf987dc3ef2530a975c562de919

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

require 'her/model'
class Camunda::Model
  include Her::Model

  api = lambda do
    Her::API.new(url: File.join(Camunda::Workflow.configuration.engine_url)) do |c|
      c.path_prefix = Camunda::Workflow.configuration.engine_route_prefix
      # Request
      c.use Faraday::Request::Multipart
      c.use FaradayMiddleware::EncodeJson
      # Response
      c.use Faraday::Response::Logger, ActiveSupport::Logger.new(STDOUT), bodies: true if Rails.env.development?
      c.use Her::Middleware::FirstLevelParseJSON

      c.use Her::Middleware::SnakeCase
      # Adapter
      c.adapter :net_http
    end
  end

  use_api api

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
camunda-workflow-0.1.1 lib/camunda/model.rb
camunda-workflow-0.1 lib/camunda/model.rb