Sha256: 5acc95679860ee00aa757f1b87eafeec9412bb9940af3b62bde55b7880e9f8c2

Contents?: true

Size: 538 Bytes

Versions: 1

Compression:

Stored size: 538 Bytes

Contents

module ServiceDowntimeSimulator
  module Modes
    class Base
      def initialize(app)
        @app = app
      end

      def call(env)
        @env = env

        [status, headers, body]
      end

      private

      def headers
        {
          'X-SDS-Mode' => identifier
        }
      end

      def body
        "Simulated Response (#{identifier})"
      end

      def status
        raise NotImplementedError
      end

      def identifier
        self.class.name
      end

      attr_reader :app, :env
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
service_downtime_simulator-0.1.0 lib/service_downtime_simulator/modes/base.rb