Sha256: 14d2b86cf50ca6f84a1d2f42d5ef837e4caf18b5fe8911b69e09052151087614

Contents?: true

Size: 309 Bytes

Versions: 2

Compression:

Stored size: 309 Bytes

Contents

module ServiceDowntimeSimulator
  module Modes
    class IntermittentlyDown < Base
      def call(env)
        return app.call(env) unless knackered?

        super
      end

      private

      def status
        500
      end

      def knackered?
        [true, false].sample
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
service_downtime_simulator-0.1.1 lib/service_downtime_simulator/modes/intermittently_down.rb
service_downtime_simulator-0.1.0 lib/service_downtime_simulator/modes/intermittently_down.rb