Sha256: 26340db3a25e034cb571e58aa4005701d0529773ffb307668f562828d5c144b6

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 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
      c.use Faraday::Request::BasicAuthentication, Camunda::Workflow.configuration.camunda_user,
            Camunda::Workflow.configuration.camunda_password
      # 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.3 lib/camunda/model.rb
camunda-workflow-0.1.2 lib/camunda/model.rb