Sha256: 0f932ed80d0a9c1fe3b375e7900838f1f1adb2d96d63951a3a13c3aa0dc15713

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

module Sbmt
  module Strangler
    class Controller
      extend Sbmt::Strangler::Configurable

      option :params_tracking_allowlist, :headers_allowlist, :flipper_actor, default_from: :configuration

      attr_reader :name, :class_name, :actions, :configuration

      def initialize(name, configuration, &)
        @name = name
        @class_name = "#{name.camelize}Controller"
        @actions = []
        @configuration = configuration

        yield(self)
      end

      def action(name, &)
        @actions.push(Sbmt::Strangler::Action.new(name, self, &))
      end

      def http
        @http ||= ActiveSupport::InheritableOptions.new(configuration.http)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sbmt-strangler-0.9.1 lib/sbmt/strangler/controller.rb