Sha256: b1e11a66070474404e32bb6fba863319c6a75d0710c8a17f61660fbe55c8de97

Contents?: true

Size: 665 Bytes

Versions: 11

Compression:

Stored size: 665 Bytes

Contents

module Alephant
  module Broker
    class Application
      attr_reader :load_strategy

      def initialize(load_strategy, c = nil)
        Broker.config = c unless c.nil?
        @load_strategy = load_strategy
      end

      def call(env)
        send response_for(environment_for(env))
      end

      def environment_for(env)
        Environment.new env
      end

      def response_for(call_environment)
        Broker.handle(load_strategy, call_environment)
      end

      def send(response)
        [
          response.status,
          response.headers,
          [
            response.content.to_s
          ]
        ]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
alephant-broker-3.19.1 lib/alephant/broker/application.rb
alephant-broker-3.19.0 lib/alephant/broker/application.rb
alephant-broker-3.18.0 lib/alephant/broker/application.rb
alephant-broker-3.17.0 lib/alephant/broker/application.rb
alephant-broker-3.16.2 lib/alephant/broker/application.rb
alephant-broker-3.16.1 lib/alephant/broker/application.rb
alephant-broker-3.16.0 lib/alephant/broker/application.rb
alephant-broker-3.15.2 lib/alephant/broker/application.rb
alephant-broker-3.15.1 lib/alephant/broker/application.rb
alephant-broker-3.15.0 lib/alephant/broker/application.rb
alephant-broker-3.14.0 lib/alephant/broker/application.rb