Sha256: ddab669244b108663a0b52b8adeb7db6ec2cbb729cc97c53ef9e8e642c635728

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

module FactoryBot
  module Instrumentation
    # The configuration for the instrumentation API.
    class Configuration
      include ActiveSupport::Configurable

      # The instrumentation configuration file path we should use,
      # defaults to config/instrumentation.yml
      config_accessor(:config_file) do
        'config/instrumentation.yml'
      end

      # You can set a fixed application name here,
      # defaults to your Rails application name in a titlized version
      config_accessor(:application_name) { nil }

      # By default we use the Rails default JSON rendering mechanism, but
      # you can configure your own logic here
      config_accessor(:render_entity) do
        proc do |controller, entity|
          controller.render plain: entity.to_json,
                            content_type: 'application/json'
        end
      end

      # By default we do not perform any custom +before_action+ filters on the
      # instrumentation controllers, with this option you can implement your
      # custom logic like authentication
      config_accessor(:before_action) { nil }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
factory_bot_instrumentation-0.5.1 lib/factory_bot/instrumentation/configuration.rb
factory_bot_instrumentation-0.5.0 lib/factory_bot/instrumentation/configuration.rb