Sha256: f561e3f44fe79438d3cb9e1fa2d85f0362267642ff4fe69ce6667c4f9e1653a7

Contents?: true

Size: 908 Bytes

Versions: 18

Compression:

Stored size: 908 Bytes

Contents

module FactoryBot
  # @api private
  class Configuration
    attr_reader(
      :callback_names,
      :factories,
      :inline_sequences,
      :sequences,
      :strategies,
      :traits
    )

    def initialize
      @factories = Decorator::DisallowsDuplicatesRegistry.new(Registry.new("Factory"))
      @sequences = Decorator::DisallowsDuplicatesRegistry.new(Registry.new("Sequence"))
      @traits = Decorator::DisallowsDuplicatesRegistry.new(Registry.new("Trait"))
      @strategies = Registry.new("Strategy")
      @callback_names = Set.new
      @definition = Definition.new(:configuration)
      @inline_sequences = []

      to_create(&:save!)
      initialize_with { new }
    end

    delegate :to_create, :skip_create, :constructor, :before, :after,
      :callback, :callbacks, to: :@definition

    def initialize_with(&block)
      @definition.define_constructor(&block)
    end
  end
end

Version data entries

18 entries across 17 versions & 3 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/factory_bot-6.5.0/lib/factory_bot/configuration.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/factory_bot-6.5.0/lib/factory_bot/configuration.rb
factory_bot-6.5.0 lib/factory_bot/configuration.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/factory_bot-6.4.6/lib/factory_bot/configuration.rb
factory_bot-6.4.6 lib/factory_bot/configuration.rb
factory_bot-6.4.5 lib/factory_bot/configuration.rb
factory_bot-6.4.4 lib/factory_bot/configuration.rb
factory_bot-6.4.3 lib/factory_bot/configuration.rb
factory_bot-6.4.2 lib/factory_bot/configuration.rb
factory_bot-6.4.1 lib/factory_bot/configuration.rb
factory_bot-6.4.0 lib/factory_bot/configuration.rb
factory_bot-6.3.0 lib/factory_bot/configuration.rb
factory_bot-6.2.1 lib/factory_bot/configuration.rb
factory_bot-6.2.0 lib/factory_bot/configuration.rb
factory_bot-6.1.0 lib/factory_bot/configuration.rb
factory_bot-6.0.2 lib/factory_bot/configuration.rb
factory_bot-6.0.1 lib/factory_bot/configuration.rb
factory_bot-6.0.0 lib/factory_bot/configuration.rb