sorbet/rbi/gems/factory_bot@6.2.1.rbi
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `factory_bot` gem.
# Please instead update this file by running `bin/tapioca gem factory_bot`.
# source://factory_bot//lib/factory_bot/internal.rb#1
module FactoryBot
extend ::FactoryBot::Syntax::Methods
extend ::FactoryBot::Syntax::Default
class << self
# Returns the value of attribute aliases.
#
# source://factory_bot//lib/factory_bot/aliases.rb#3
def aliases; end
# Sets the attribute aliases
#
# @param value the value to set the attribute aliases to.
#
# source://factory_bot//lib/factory_bot/aliases.rb#3
def aliases=(_arg0); end
# source://factory_bot//lib/factory_bot/aliases.rb#11
def aliases_for(attribute); end
# source://factory_bot//lib/factory_bot.rb#57
def automatically_define_enum_traits; end
# source://factory_bot//lib/factory_bot.rb#57
def automatically_define_enum_traits=(val); end
# Set the starting value for ids when using the build_stubbed strategy
#
# Arguments:
# * starting_id +Integer+
# The new starting id value.
#
# source://factory_bot//lib/factory_bot.rb#78
def build_stubbed_starting_id=(starting_id); end
# An Array of strings specifying locations that should be searched for
# factory definitions. By default, factory_bot will attempt to require
# "factories", "test/factories" and "spec/factories". Only the first
# existing file will be loaded.
#
# source://factory_bot//lib/factory_bot/find_definitions.rb#7
def definition_file_paths; end
# An Array of strings specifying locations that should be searched for
# factory definitions. By default, factory_bot will attempt to require
# "factories", "test/factories" and "spec/factories". Only the first
# existing file will be loaded.
#
# source://factory_bot//lib/factory_bot/find_definitions.rb#7
def definition_file_paths=(_arg0); end
# source://factory_bot//lib/factory_bot.rb#83
def factories(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/find_definitions.rb#12
def find_definitions; end
# Look for errors in factories and (optionally) their traits.
# Parameters:
# factories - which factories to lint; omit for all factories
# options:
# traits: true - to lint traits as well as factories
# strategy: :create - to specify the strategy for linting
# verbose: true - to include full backtraces for each linting error
#
# source://factory_bot//lib/factory_bot.rb#67
def lint(*args); end
# source://factory_bot//lib/factory_bot.rb#83
def register_strategy(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/reload.rb#2
def reload; end
# source://factory_bot//lib/factory_bot.rb#83
def rewind_sequences(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot.rb#83
def strategy_by_name(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot.rb#54
def use_parent_strategy; end
# source://factory_bot//lib/factory_bot.rb#54
def use_parent_strategy=(val); end
end
end
# Raised when attempting to pass a block to an association definition
#
# source://factory_bot//lib/factory_bot/errors.rb#3
class FactoryBot::AssociationDefinitionError < ::RuntimeError; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/dynamic.rb#2
class FactoryBot::Attribute
# @api private
# @return [Attribute] a new instance of Attribute
#
# source://factory_bot//lib/factory_bot/attribute.rb#10
def initialize(name, ignored); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/attribute.rb#23
def alias_for?(attr); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/attribute.rb#19
def association?; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute.rb#8
def ignored; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute.rb#8
def name; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute.rb#15
def to_proc; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/association.rb#4
class FactoryBot::Attribute::Association < ::FactoryBot::Attribute
# @api private
# @return [Association] a new instance of Association
#
# source://factory_bot//lib/factory_bot/attribute/association.rb#7
def initialize(name, factory, overrides); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/attribute/association.rb#22
def association?; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/association.rb#5
def factory; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/association.rb#13
def to_proc; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/dynamic.rb#4
class FactoryBot::Attribute::Dynamic < ::FactoryBot::Attribute
# @api private
# @return [Dynamic] a new instance of Dynamic
#
# source://factory_bot//lib/factory_bot/attribute/dynamic.rb#5
def initialize(name, ignored, block); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/dynamic.rb#10
def to_proc; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/sequence.rb#4
class FactoryBot::Attribute::Sequence < ::FactoryBot::Attribute
# @api private
# @return [Sequence] a new instance of Sequence
#
# source://factory_bot//lib/factory_bot/attribute/sequence.rb#5
def initialize(name, sequence, ignored); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute/sequence.rb#10
def to_proc; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#3
class FactoryBot::AttributeAssigner
# @api private
# @return [AttributeAssigner] a new instance of AttributeAssigner
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#4
def initialize(evaluator, build_class, &instance_builder); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#22
def hash; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#12
def object; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#98
def alias_names_to_ignore; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#86
def association_names; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#70
def attribute_names_to_assign; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#66
def attributes_to_set_on_hash; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#62
def attributes_to_set_on_instance; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#50
def build_class_instance; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#54
def build_hash; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#39
def decorated_evaluator; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#58
def get(attribute_name); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#94
def hash_instance_methods_to_respond_to; end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#106
def ignorable_alias?(attribute, override); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#82
def ignored_attribute_names; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#32
def method_tracking_evaluator; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#46
def methods_invoked_on_evaluator; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#78
def non_ignored_attribute_names; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_assigner.rb#90
def override_names; end
end
# Raised when defining an attribute twice in the same factory
#
# source://factory_bot//lib/factory_bot/errors.rb#18
class FactoryBot::AttributeDefinitionError < ::RuntimeError; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#3
class FactoryBot::AttributeList
include ::Enumerable
# @api private
# @return [AttributeList] a new instance of AttributeList
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#6
def initialize(name = T.unsafe(nil), attributes = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#38
def apply_attributes(attributes_to_apply); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#26
def associations; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#11
def define_attribute(attribute); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#18
def each(&block); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#30
def ignored; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#22
def names; end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#34
def non_ignored; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#44
def add_attribute(attribute); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#62
def attribute_defined?(attribute_name); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#49
def ensure_attribute_not_defined!(attribute); end
# @api private
#
# source://factory_bot//lib/factory_bot/attribute_list.rb#55
def ensure_attribute_not_self_referencing!(attribute); end
end
# source://factory_bot//lib/factory_bot/callback.rb#2
class FactoryBot::Callback
# @return [Callback] a new instance of Callback
#
# source://factory_bot//lib/factory_bot/callback.rb#5
def initialize(name, block); end
# source://factory_bot//lib/factory_bot/callback.rb#18
def ==(other); end
# Returns the value of attribute name.
#
# source://factory_bot//lib/factory_bot/callback.rb#3
def name; end
# source://factory_bot//lib/factory_bot/callback.rb#10
def run(instance, evaluator); end
protected
# Returns the value of attribute block.
#
# source://factory_bot//lib/factory_bot/callback.rb#25
def block; end
private
# source://factory_bot//lib/factory_bot/callback.rb#29
def syntax_runner; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/callbacks_observer.rb#3
class FactoryBot::CallbacksObserver
# @api private
# @return [CallbacksObserver] a new instance of CallbacksObserver
#
# source://factory_bot//lib/factory_bot/callbacks_observer.rb#4
def initialize(callbacks, evaluator); end
# @api private
#
# source://factory_bot//lib/factory_bot/callbacks_observer.rb#9
def update(name, result_instance); end
private
# @api private
#
# source://factory_bot//lib/factory_bot/callbacks_observer.rb#17
def callbacks_by_name(name); end
end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#3
class FactoryBot::Configuration
# @api private
# @return [Configuration] a new instance of Configuration
#
# source://factory_bot//lib/factory_bot/configuration.rb#13
def initialize; end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def after(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def before(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def callback(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#4
def callback_names; end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def callbacks(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def constructor(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#4
def factories; end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#29
def initialize_with(&block); end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#4
def inline_sequences; end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#4
def sequences; end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def skip_create(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#4
def strategies; end
# source://factory_bot//lib/factory_bot/configuration.rb#26
def to_create(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/configuration.rb#4
def traits; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/dynamic.rb#2
class FactoryBot::Declaration
# @api private
# @return [Declaration] a new instance of Declaration
#
# source://factory_bot//lib/factory_bot/declaration.rb#10
def initialize(name, ignored = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration.rb#8
def name; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration.rb#15
def to_attributes; end
protected
# @api private
#
# source://factory_bot//lib/factory_bot/declaration.rb#21
def ignored; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#4
class FactoryBot::Declaration::Association < ::FactoryBot::Declaration
# @api private
# @return [Association] a new instance of Association
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#5
def initialize(name, *options); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#13
def ==(other); end
protected
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#21
def options; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#27
def build; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#25
def factory_name; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#25
def overrides; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#39
def raise_if_arguments_are_declarations!; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/association.rb#25
def traits; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/dynamic.rb#4
class FactoryBot::Declaration::Dynamic < ::FactoryBot::Declaration
# @api private
# @return [Dynamic] a new instance of Dynamic
#
# source://factory_bot//lib/factory_bot/declaration/dynamic.rb#5
def initialize(name, ignored = T.unsafe(nil), block = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/dynamic.rb#10
def ==(other); end
protected
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/dynamic.rb#19
def block; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/dynamic.rb#23
def build; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/implicit.rb#4
class FactoryBot::Declaration::Implicit < ::FactoryBot::Declaration
# @api private
# @return [Implicit] a new instance of Implicit
#
# source://factory_bot//lib/factory_bot/declaration/implicit.rb#5
def initialize(name, factory = T.unsafe(nil), ignored = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/implicit.rb#10
def ==(other); end
protected
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/implicit.rb#19
def factory; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/declaration/implicit.rb#23
def build; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#3
class FactoryBot::DeclarationList
include ::Enumerable
# @api private
# @return [DeclarationList] a new instance of DeclarationList
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#6
def initialize(name = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#23
def attributes; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#12
def declare_attribute(declaration); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#31
def each(&block); end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#19
def overridable; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#37
def delete_declaration(declaration); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#45
def overridable?; end
# @api private
#
# source://factory_bot//lib/factory_bot/declaration_list.rb#41
def to_attributes; end
end
# source://factory_bot//lib/factory_bot/decorator.rb#2
class FactoryBot::Decorator < ::BasicObject
# @return [Decorator] a new instance of Decorator
#
# source://factory_bot//lib/factory_bot/decorator.rb#5
def initialize(component); end
# source://factory_bot//lib/factory_bot/decorator.rb#11
def method_missing(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/decorator.rb#15
def send(*_arg0, **_arg1, &_arg2); end
private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/decorator.rb#29
def respond_to_missing?(name, include_private = T.unsafe(nil)); end
class << self
# source://factory_bot//lib/factory_bot/decorator.rb#33
def const_missing(name); end
end
end
# source://factory_bot//lib/factory_bot/decorator/attribute_hash.rb#3
class FactoryBot::Decorator::AttributeHash < ::FactoryBot::Decorator
# @return [AttributeHash] a new instance of AttributeHash
#
# source://factory_bot//lib/factory_bot/decorator/attribute_hash.rb#4
def initialize(component, attributes = T.unsafe(nil)); end
# source://factory_bot//lib/factory_bot/decorator/attribute_hash.rb#9
def attributes; end
end
# source://factory_bot//lib/factory_bot/decorator/disallows_duplicates_registry.rb#3
class FactoryBot::Decorator::DisallowsDuplicatesRegistry < ::FactoryBot::Decorator
# source://factory_bot//lib/factory_bot/decorator/disallows_duplicates_registry.rb#4
def register(name, item); end
end
# source://factory_bot//lib/factory_bot/decorator/invocation_tracker.rb#3
class FactoryBot::Decorator::InvocationTracker < ::FactoryBot::Decorator
# @return [InvocationTracker] a new instance of InvocationTracker
#
# source://factory_bot//lib/factory_bot/decorator/invocation_tracker.rb#4
def initialize(component); end
# source://factory_bot//lib/factory_bot/decorator/invocation_tracker.rb#15
def __invoked_methods__; end
# source://factory_bot//lib/factory_bot/decorator/invocation_tracker.rb#9
def method_missing(name, *args, **_arg2, &block); end
end
# source://factory_bot//lib/factory_bot/decorator/new_constructor.rb#3
class FactoryBot::Decorator::NewConstructor < ::FactoryBot::Decorator
# @return [NewConstructor] a new instance of NewConstructor
#
# source://factory_bot//lib/factory_bot/decorator/new_constructor.rb#4
def initialize(component, build_class); end
# source://factory_bot//lib/factory_bot/decorator/new_constructor.rb#9
def new(*_arg0, **_arg1, &_arg2); end
end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#3
class FactoryBot::Definition
# @api private
# @return [Definition] a new instance of Definition
#
# source://factory_bot//lib/factory_bot/definition.rb#6
def initialize(name, base_traits = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#76
def add_callback(callback); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#100
def after(*names, &block); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#72
def append_traits(new_traits); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#23
def attributes; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#96
def before(*names, &block); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#104
def callback(*names, &block); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#44
def callbacks; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#48
def compile(klass = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#40
def constructor; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#4
def declarations; end
# source://factory_bot//lib/factory_bot/definition.rb#21
def declare_attribute(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#92
def define_constructor(&block); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#84
def define_trait(trait); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#4
def defined_traits; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#68
def inherit_traits(new_traits); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#4
def name; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#63
def overridable; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#88
def register_enum(enum); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#4
def registered_enums; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#80
def skip_create; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#32
def to_create(&block); end
private
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#130
def additional_traits; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#150
def aggregate_from_traits_and_self(method_name, &block); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#175
def automatically_register_defined_enums(klass); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/definition.rb#179
def automatically_register_defined_enums?(klass); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#112
def base_traits; end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#118
def error_with_definition_name(error); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#160
def expand_enum_traits(klass); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#143
def initialize_copy(source); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#134
def trait_by_name(name); end
# @api private
#
# source://factory_bot//lib/factory_bot/definition.rb#138
def trait_for(name); end
end
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#2
class FactoryBot::DefinitionHierarchy
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#3
def callbacks(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#3
def constructor(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#3
def to_create(*_arg0, **_arg1, &_arg2); end
class << self
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#5
def build_from_definition(definition); end
private
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#11
def add_callbacks(callbacks); end
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#20
def build_constructor(&block); end
# source://factory_bot//lib/factory_bot/definition_hierarchy.rb#29
def build_to_create(&block); end
end
end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#2
class FactoryBot::DefinitionProxy
# @return [DefinitionProxy] a new instance of DefinitionProxy
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#26
def initialize(definition, ignore = T.unsafe(nil)); end
# Adds an attribute to the factory.
# The attribute value will be generated "lazily"
# by calling the block whenever an instance is generated.
# The block will not be called if the
# attribute is overridden for a specific instance.
#
# Arguments:
# * name: +Symbol+ or +String+
# The name of this attribute. This will be assigned using "name=" for
# generated instances.
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#47
def add_attribute(name, &block); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#22
def after(*_arg0, **_arg1, &_arg2); end
# Adds an attribute that builds an association. The associated instance will
# be built using the same build strategy as the parent instance.
#
# Example:
# factory :user do
# name 'Joey'
# end
#
# factory :post do
# association :author, factory: :user
# end
#
# Arguments:
# * name: +Symbol+
# The name of this attribute.
# * options: +Hash+
#
# Options:
# * factory: +Symbol+ or +String+
# The name of the factory to use when building the associated instance.
# If no name is given, the name of the attribute is assumed to be the
# name of the factory. For example, a "user" association will by
# default use the "user" factory.
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#151
def association(name, *options); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#22
def before(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#22
def callback(*_arg0, **_arg1, &_arg2); end
# Returns the value of attribute child_factories.
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#24
def child_factories; end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#171
def factory(name, options = T.unsafe(nil), &block); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#237
def initialize_with(&block); end
# Calls add_attribute using the missing method name as the name of the
# attribute, so that:
#
# factory :user do
# name { 'Billy Idol' }
# end
#
# and:
#
# factory :user do
# add_attribute(:name) { 'Billy Idol' }
# end
#
# are equivalent.
#
# If no argument or block is given, factory_bot will first look for an
# association, then for a sequence, and finally for a trait with the same
# name. This means that given an "admin" trait, an "email" sequence, and an
# "account" factory:
#
# factory :user, traits: [:admin] do
# email { generate(:email) }
# association :account
# end
#
# and:
#
# factory :user do
# admin
# email
# account
# end
#
# are equivalent.
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#91
def method_missing(name, *args, &block); end
# Adds an attribute that will have unique values generated by a sequence with
# a specified format.
#
# The result of:
# factory :user do
# sequence(:email) { |n| "person#{n}@example.com" }
# end
#
# Is equal to:
# sequence(:email) { |n| "person#{n}@example.com" }
#
# factory :user do
# email { FactoryBot.generate(:email) }
# end
#
# Except that no globally available sequence will be defined.
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#122
def sequence(name, *args, &block); end
# @raise [FactoryBot::MethodDefinitionError]
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#32
def singleton_method_added(name); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#167
def skip_create; end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#163
def to_create(&block); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#175
def trait(name, &block); end
# Creates traits for enumerable values.
#
# Example:
# factory :task do
# traits_for_enum :status, [:started, :finished]
# end
#
# Equivalent to:
# factory :task do
# trait :started do
# status { :started }
# end
#
# trait :finished do
# status { :finished }
# end
# end
#
# Example:
# factory :task do
# traits_for_enum :status, {started: 1, finished: 2}
# end
#
# Example:
# class Task
# def statuses
# {started: 1, finished: 2}
# end
# end
#
# factory :task do
# traits_for_enum :status
# end
#
# Both equivalent to:
# factory :task do
# trait :started do
# status { 1 }
# end
#
# trait :finished do
# status { 2 }
# end
# end
#
#
# Arguments:
# attribute_name: +Symbol+ or +String+
# the name of the attribute these traits will set the value of
# values: +Array+, +Hash+, or other +Enumerable+
# An array of trait names, or a mapping of trait names to values for
# those traits. When this argument is not provided, factory_bot will
# attempt to get the values by calling the pluralized `attribute_name`
# class method.
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#233
def traits_for_enum(attribute_name, values = T.unsafe(nil)); end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#52
def transient(&block); end
private
# source://factory_bot//lib/factory_bot/definition_proxy.rb#243
def __declare_attribute__(name, block); end
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/definition_proxy.rb#252
def __valid_association_options?(options); end
end
# source://factory_bot//lib/factory_bot/definition_proxy.rb#3
FactoryBot::DefinitionProxy::UNPROXIED_METHODS = T.let(T.unsafe(nil), Array)
# source://factory_bot//lib/factory_bot.rb#52
FactoryBot::Deprecation = T.let(T.unsafe(nil), ActiveSupport::Deprecation)
# Raised when a factory is defined with the same name as a previously-defined factory.
#
# source://factory_bot//lib/factory_bot/errors.rb#12
class FactoryBot::DuplicateDefinitionError < ::RuntimeError; end
# @api private
#
# source://factory_bot//lib/factory_bot/enum.rb#3
class FactoryBot::Enum
# @api private
# @return [Enum] a new instance of Enum
#
# source://factory_bot//lib/factory_bot/enum.rb#4
def initialize(attribute_name, values = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/enum.rb#9
def build_traits(klass); end
private
# @api private
#
# source://factory_bot//lib/factory_bot/enum.rb#21
def build_trait(trait_name, attribute_name, value); end
# @api private
#
# source://factory_bot//lib/factory_bot/enum.rb#17
def enum_values(klass); end
end
# source://factory_bot//lib/factory_bot/evaluation.rb#4
class FactoryBot::Evaluation
include ::Observable
# @return [Evaluation] a new instance of Evaluation
#
# source://factory_bot//lib/factory_bot/evaluation.rb#7
def initialize(evaluator, attribute_assigner, to_create); end
# source://factory_bot//lib/factory_bot/evaluation.rb#15
def create(result_instance); end
# source://factory_bot//lib/factory_bot/evaluation.rb#13
def hash(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/evaluation.rb#22
def notify(name, result_instance); end
# source://factory_bot//lib/factory_bot/evaluation.rb#13
def object(*_arg0, **_arg1, &_arg2); end
end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#6
class FactoryBot::Evaluator
# @api private
# @return [Evaluator] a new instance of Evaluator
#
# source://factory_bot//lib/factory_bot/evaluator.rb#13
def initialize(build_strategy, overrides = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#51
def __override_names__; end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#24
def association(factory_name, *traits_and_overrides); end
# source://factory_bot//lib/factory_bot/evaluator.rb#7
def attribute_lists; end
# source://factory_bot//lib/factory_bot/evaluator.rb#7
def attribute_lists=(_arg0); end
# source://factory_bot//lib/factory_bot/evaluator.rb#7
def attribute_lists?; end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#55
def increment_sequence(sequence); end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#36
def instance; end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#36
def instance=(_arg0); end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#38
def method_missing(method_name, *args, **_arg2, &block); end
private
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/evaluator.rb#47
def respond_to_missing?(method_name, _include_private = T.unsafe(nil)); end
class << self
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#59
def attribute_list; end
# source://factory_bot//lib/factory_bot/evaluator.rb#7
def attribute_lists; end
# source://factory_bot//lib/factory_bot/evaluator.rb#7
def attribute_lists=(value); end
# source://factory_bot//lib/factory_bot/evaluator.rb#7
def attribute_lists?; end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator.rb#67
def define_attribute(name, &block); end
end
end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator_class_definer.rb#3
class FactoryBot::EvaluatorClassDefiner
# @api private
# @return [EvaluatorClassDefiner] a new instance of EvaluatorClassDefiner
#
# source://factory_bot//lib/factory_bot/evaluator_class_definer.rb#4
def initialize(attributes, parent_class); end
# @api private
#
# source://factory_bot//lib/factory_bot/evaluator_class_definer.rb#13
def evaluator_class; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#6
class FactoryBot::Factory
# @api private
# @return [Factory] a new instance of Factory
#
# source://factory_bot//lib/factory_bot/factory.rb#9
def initialize(name, options = T.unsafe(nil)); end
# source://factory_bot//lib/factory_bot/factory.rb#19
def add_callback(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/factory.rb#19
def append_traits(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#50
def associations; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#22
def build_class; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#83
def compile; end
# source://factory_bot//lib/factory_bot/factory.rb#19
def constructor(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/factory.rb#19
def declare_attribute(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/factory.rb#19
def define_trait(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/factory.rb#19
def defined_traits(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#7
def definition; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#46
def human_names; end
# source://factory_bot//lib/factory_bot/factory.rb#19
def inherit_traits(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#7
def name; end
# Names for this factory, including aliases.
#
# Example:
#
# factory :user, aliases: [:author] do
# # ...
# end
#
# FactoryBot.create(:author).class
# # => User
#
# Because an attribute defined without a value or block will build an
# association with the same name, this allows associations to be defined
# without factories, such as:
#
# factory :user, aliases: [:author] do
# # ...
# end
#
# factory :post do
# author
# end
#
# FactoryBot.create(:post).author.class
# # => User
#
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#79
def names; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#30
def run(build_strategy, overrides, &block); end
# source://factory_bot//lib/factory_bot/factory.rb#19
def to_create(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#93
def with_traits(traits); end
protected
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#109
def attributes; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#124
def build_hierarchy; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#128
def callbacks; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#101
def class_name; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#136
def compiled_constructor; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#132
def compiled_to_create; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#105
def evaluator_class; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#116
def hierarchy_class; end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#120
def hierarchy_instance; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#142
def assert_valid_options(options); end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#154
def initialize_copy(source); end
# @api private
#
# source://factory_bot//lib/factory_bot/factory.rb#146
def parent; end
end
# source://factory_bot//lib/factory_bot/factory_runner.rb#2
class FactoryBot::FactoryRunner
# @return [FactoryRunner] a new instance of FactoryRunner
#
# source://factory_bot//lib/factory_bot/factory_runner.rb#3
def initialize(name, strategy, traits_and_overrides); end
# source://factory_bot//lib/factory_bot/factory_runner.rb#11
def run(runner_strategy = T.unsafe(nil), &block); end
end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#3
module FactoryBot::Internal
class << self
# source://factory_bot//lib/factory_bot/internal.rb#5
def after(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def before(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def callbacks(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#19
def configuration; end
# source://factory_bot//lib/factory_bot/internal.rb#5
def constructor(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def factories(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#69
def factory_by_name(name); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def initialize_with(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def inline_sequences(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#82
def register_default_strategies; end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#62
def register_factory(factory); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#27
def register_inline_sequence(sequence); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#46
def register_sequence(sequence); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#73
def register_strategy(strategy_name, strategy_class); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#35
def register_trait(trait); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#23
def reset_configuration; end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#31
def rewind_inline_sequences; end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#57
def rewind_sequences; end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#53
def sequence_by_name(name); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def sequences(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def skip_create(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def strategies(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#78
def strategy_by_name(name); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def to_create(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/internal.rb#42
def trait_by_name(name); end
# source://factory_bot//lib/factory_bot/internal.rb#5
def traits(*_arg0, **_arg1, &_arg2); end
end
end
# Raised when a callback is defined that has an invalid name
#
# source://factory_bot//lib/factory_bot/errors.rb#9
class FactoryBot::InvalidCallbackNameError < ::RuntimeError; end
# Raised when any factory is considered invalid
#
# source://factory_bot//lib/factory_bot/errors.rb#27
class FactoryBot::InvalidFactoryError < ::RuntimeError; end
# source://factory_bot//lib/factory_bot/linter.rb#2
class FactoryBot::Linter
# @return [Linter] a new instance of Linter
#
# source://factory_bot//lib/factory_bot/linter.rb#3
def initialize(factories, strategy: T.unsafe(nil), traits: T.unsafe(nil), verbose: T.unsafe(nil)); end
# source://factory_bot//lib/factory_bot/linter.rb#11
def lint!; end
private
# source://factory_bot//lib/factory_bot/linter.rb#21
def calculate_invalid_factories; end
# source://factory_bot//lib/factory_bot/linter.rb#90
def error_message; end
# source://factory_bot//lib/factory_bot/linter.rb#102
def error_message_type; end
# Returns the value of attribute factories_to_lint.
#
# source://factory_bot//lib/factory_bot/linter.rb#19
def factories_to_lint; end
# Returns the value of attribute factory_strategy.
#
# source://factory_bot//lib/factory_bot/linter.rb#19
def factory_strategy; end
# Returns the value of attribute invalid_factories.
#
# source://factory_bot//lib/factory_bot/linter.rb#19
def invalid_factories; end
# source://factory_bot//lib/factory_bot/linter.rb#62
def lint(factory); end
# source://factory_bot//lib/factory_bot/linter.rb#70
def lint_factory(factory); end
# source://factory_bot//lib/factory_bot/linter.rb#80
def lint_traits(factory); end
end
# source://factory_bot//lib/factory_bot/linter.rb#28
class FactoryBot::Linter::FactoryError
# @return [FactoryError] a new instance of FactoryError
#
# source://factory_bot//lib/factory_bot/linter.rb#29
def initialize(wrapped_error, factory); end
# source://factory_bot//lib/factory_bot/linter.rb#46
def location; end
# source://factory_bot//lib/factory_bot/linter.rb#34
def message; end
# source://factory_bot//lib/factory_bot/linter.rb#39
def verbose_message; end
end
# source://factory_bot//lib/factory_bot/linter.rb#51
class FactoryBot::Linter::FactoryTraitError < ::FactoryBot::Linter::FactoryError
# @return [FactoryTraitError] a new instance of FactoryTraitError
#
# source://factory_bot//lib/factory_bot/linter.rb#52
def initialize(wrapped_error, factory, trait_name); end
# source://factory_bot//lib/factory_bot/linter.rb#57
def location; end
end
# Raised when a method is defined in a factory or trait with arguments
#
# source://factory_bot//lib/factory_bot/errors.rb#24
class FactoryBot::MethodDefinitionError < ::RuntimeError; end
# @api private
#
# source://factory_bot//lib/factory_bot/null_factory.rb#3
class FactoryBot::NullFactory
# @api private
# @return [NullFactory] a new instance of NullFactory
#
# source://factory_bot//lib/factory_bot/null_factory.rb#6
def initialize; end
# source://factory_bot//lib/factory_bot/null_factory.rb#10
def attributes(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/null_factory.rb#10
def callbacks(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/null_factory.rb#16
def class_name; end
# @api private
#
# source://factory_bot//lib/factory_bot/null_factory.rb#13
def compile; end
# source://factory_bot//lib/factory_bot/null_factory.rb#10
def constructor(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/null_factory.rb#10
def defined_traits(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/null_factory.rb#4
def definition; end
# @api private
#
# source://factory_bot//lib/factory_bot/null_factory.rb#19
def evaluator_class; end
# @api private
#
# source://factory_bot//lib/factory_bot/null_factory.rb#23
def hierarchy_class; end
# source://factory_bot//lib/factory_bot/null_factory.rb#10
def to_create(*_arg0, **_arg1, &_arg2); end
end
# @api private
#
# source://factory_bot//lib/factory_bot/null_object.rb#3
class FactoryBot::NullObject < ::BasicObject
# @api private
# @return [NullObject] a new instance of NullObject
#
# source://factory_bot//lib/factory_bot/null_object.rb#4
def initialize(methods_to_respond_to); end
# @api private
#
# source://factory_bot//lib/factory_bot/null_object.rb#8
def method_missing(name, *args, &block); end
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/null_object.rb#16
def respond_to?(method); end
end
# source://factory_bot//lib/factory_bot/registry.rb#4
class FactoryBot::Registry
include ::Enumerable
# @return [Registry] a new instance of Registry
#
# source://factory_bot//lib/factory_bot/registry.rb#9
def initialize(name); end
# source://factory_bot//lib/factory_bot/registry.rb#22
def [](name); end
# source://factory_bot//lib/factory_bot/registry.rb#14
def clear; end
# source://factory_bot//lib/factory_bot/registry.rb#18
def each(&block); end
# source://factory_bot//lib/factory_bot/registry.rb#22
def find(name); end
# Returns the value of attribute name.
#
# source://factory_bot//lib/factory_bot/registry.rb#7
def name; end
# source://factory_bot//lib/factory_bot/registry.rb#30
def register(name, item); end
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/registry.rb#34
def registered?(name); end
private
# source://factory_bot//lib/factory_bot/registry.rb#40
def key_error_with_custom_message(key_error); end
end
# Sequences are defined using sequence within a FactoryBot.define block.
# Sequence values are generated using next.
#
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#5
class FactoryBot::Sequence
# @api private
# @return [Sequence] a new instance of Sequence
#
# source://factory_bot//lib/factory_bot/sequence.rb#8
def initialize(name, *args, &proc); end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#6
def name; end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#33
def names; end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#21
def next(scope = T.unsafe(nil)); end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#37
def rewind; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#47
def increment_value; end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#43
def value; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#51
class FactoryBot::Sequence::EnumeratorAdapter
# @api private
# @return [EnumeratorAdapter] a new instance of EnumeratorAdapter
#
# source://factory_bot//lib/factory_bot/sequence.rb#52
def initialize(value); end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#61
def next; end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#57
def peek; end
# @api private
#
# source://factory_bot//lib/factory_bot/sequence.rb#65
def rewind; end
end
# Raised when attempting to register a sequence from a dynamic attribute block
#
# source://factory_bot//lib/factory_bot/errors.rb#15
class FactoryBot::SequenceAbuseError < ::RuntimeError; end
# source://factory_bot//lib/factory_bot/strategy/build.rb#2
module FactoryBot::Strategy; end
# source://factory_bot//lib/factory_bot/strategy/attributes_for.rb#3
class FactoryBot::Strategy::AttributesFor
# source://factory_bot//lib/factory_bot/strategy/attributes_for.rb#4
def association(runner); end
# source://factory_bot//lib/factory_bot/strategy/attributes_for.rb#8
def result(evaluation); end
# source://factory_bot//lib/factory_bot/strategy/attributes_for.rb#12
def to_sym; end
end
# source://factory_bot//lib/factory_bot/strategy/build.rb#3
class FactoryBot::Strategy::Build
# source://factory_bot//lib/factory_bot/strategy/build.rb#4
def association(runner); end
# source://factory_bot//lib/factory_bot/strategy/build.rb#8
def result(evaluation); end
# source://factory_bot//lib/factory_bot/strategy/build.rb#14
def to_sym; end
end
# source://factory_bot//lib/factory_bot/strategy/create.rb#3
class FactoryBot::Strategy::Create
# source://factory_bot//lib/factory_bot/strategy/create.rb#4
def association(runner); end
# source://factory_bot//lib/factory_bot/strategy/create.rb#8
def result(evaluation); end
# source://factory_bot//lib/factory_bot/strategy/create.rb#17
def to_sym; end
end
# source://factory_bot//lib/factory_bot/strategy/null.rb#3
class FactoryBot::Strategy::Null
# source://factory_bot//lib/factory_bot/strategy/null.rb#4
def association(runner); end
# source://factory_bot//lib/factory_bot/strategy/null.rb#7
def result(evaluation); end
# source://factory_bot//lib/factory_bot/strategy/null.rb#10
def to_sym; end
end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#3
class FactoryBot::Strategy::Stub
# source://factory_bot//lib/factory_bot/strategy/stub.rb#31
def association(runner); end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#35
def result(evaluation); end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#44
def to_sym; end
private
# source://factory_bot//lib/factory_bot/strategy/stub.rb#86
def clear_changes_information(result_instance); end
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/strategy/stub.rb#81
def has_settable_id?(result_instance); end
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/strategy/stub.rb#102
def missing_created_at?(result_instance); end
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/strategy/stub.rb#108
def missing_updated_at?(result_instance); end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#50
def next_id; end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#92
def set_timestamps(result_instance); end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#54
def stub_database_interaction_on_result(result_instance); end
class << self
# source://factory_bot//lib/factory_bot/strategy/stub.rb#27
def next_id=(id); end
end
end
# source://factory_bot//lib/factory_bot/strategy/stub.rb#6
FactoryBot::Strategy::Stub::DISABLED_PERSISTENCE_METHODS = T.let(T.unsafe(nil), Array)
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_calculator.rb#3
class FactoryBot::StrategyCalculator
# @api private
# @return [StrategyCalculator] a new instance of StrategyCalculator
#
# source://factory_bot//lib/factory_bot/strategy_calculator.rb#4
def initialize(name_or_object); end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_calculator.rb#8
def strategy; end
private
# @api private
# @return [Boolean]
#
# source://factory_bot//lib/factory_bot/strategy_calculator.rb#18
def strategy_is_object?; end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_calculator.rb#22
def strategy_name_to_object; end
end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#3
class FactoryBot::StrategySyntaxMethodRegistrar
# @api private
# @return [StrategySyntaxMethodRegistrar] a new instance of StrategySyntaxMethodRegistrar
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#4
def initialize(strategy_name); end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#8
def define_strategy_methods; end
private
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#32
def define_list_strategy_method; end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#47
def define_pair_strategy_method; end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#24
def define_singular_strategy_method; end
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#55
def define_syntax_method(name, &block); end
class << self
# @api private
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#14
def with_index(block, index); end
end
end
# source://factory_bot//lib/factory_bot/syntax/methods.rb#2
module FactoryBot::Syntax; end
# source://factory_bot//lib/factory_bot/syntax/default.rb#3
module FactoryBot::Syntax::Default
include ::FactoryBot::Syntax::Methods
# source://factory_bot//lib/factory_bot/syntax/default.rb#6
def define(&block); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#10
def modify(&block); end
end
# source://factory_bot//lib/factory_bot/syntax/default.rb#14
class FactoryBot::Syntax::Default::DSL
# source://factory_bot//lib/factory_bot/syntax/default.rb#40
def after(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#40
def before(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#40
def callback(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#15
def factory(name, options = T.unsafe(nil), &block); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#40
def initialize_with(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#28
def sequence(name, *args, &block); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#40
def skip_create(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#40
def to_create(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/syntax/default.rb#32
def trait(name, &block); end
class << self
# source://factory_bot//lib/factory_bot/syntax/default.rb#36
def run(block); end
end
end
# source://factory_bot//lib/factory_bot/syntax/default.rb#49
class FactoryBot::Syntax::Default::ModifyDSL
# source://factory_bot//lib/factory_bot/syntax/default.rb#50
def factory(name, _options = T.unsafe(nil), &block); end
class << self
# source://factory_bot//lib/factory_bot/syntax/default.rb#56
def run(block); end
end
end
# This module is a container for all strategy methods provided by
# FactoryBot. This includes all the default strategies provided ({Methods#build},
# {Methods#create}, {Methods#build_stubbed}, and {Methods#attributes_for}), as
# well as the complementary *_list and *_pair methods.
#
# @example singular factory execution
# # basic use case
# build(:completed_order)
#
# # factory yielding its result to a block
# create(:post) do |post|
# create(:comment, post: post)
# end
#
# # factory with attribute override
# attributes_for(:post, title: "I love Ruby!")
#
# # factory with traits and attribute override
# build_stubbed(:user, :admin, :male, name: "John Doe")
# @example multiple factory execution
# # basic use case
# build_list(:completed_order, 2)
# create_list(:completed_order, 2)
#
# # factory with attribute override
# attributes_for_list(:post, 4, title: "I love Ruby!")
#
# # factory with traits and attribute override
# build_stubbed_list(:user, 15, :admin, :male, name: "John Doe")
#
# source://factory_bot//lib/factory_bot/syntax/methods.rb#32
module FactoryBot::Syntax::Methods
# (see #strategy_method)
# Generates a hash of attributes for a registered factory by name.
#
# @return [Hash] hash of attributes for the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#27
def attributes_for(name, *traits_and_overrides, &block); end
# (see #strategy_method_list)
#
# @return [Array<Hash>] array of attribute hashes for the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#35
def attributes_for_list(name, amount, *traits_and_overrides, &block); end
# (see #strategy_method_pair)
#
# @return [Array<Hash>] pair of attribute hashes for the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#50
def attributes_for_pair(name, *traits_and_overrides, &block); end
# (see #strategy_method)
# Builds a registered factory by name.
#
# @return [Object] instantiated object defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#27
def build(name, *traits_and_overrides, &block); end
# (see #strategy_method_list)
#
# @return [Array] array of built objects defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#35
def build_list(name, amount, *traits_and_overrides, &block); end
# (see #strategy_method_pair)
#
# @return [Array] pair of built objects defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#50
def build_pair(name, *traits_and_overrides, &block); end
# (see #strategy_method)
# Builds a stubbed registered factory by name.
#
# @return [Object] instantiated object defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#27
def build_stubbed(name, *traits_and_overrides, &block); end
# (see #strategy_method_list)
#
# @return [Array] array of stubbed objects defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#35
def build_stubbed_list(name, amount, *traits_and_overrides, &block); end
# (see #strategy_method_pair)
#
# @return [Array] pair of stubbed objects defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#50
def build_stubbed_pair(name, *traits_and_overrides, &block); end
# (see #strategy_method)
# Creates a registered factory by name.
#
# @return [Object] instantiated object defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#27
def create(name, *traits_and_overrides, &block); end
# (see #strategy_method_list)
#
# @return [Array] array of created objects defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#35
def create_list(name, amount, *traits_and_overrides, &block); end
# (see #strategy_method_pair)
#
# @return [Array] pair of created objects defined by the factory
#
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#50
def create_pair(name, *traits_and_overrides, &block); end
# Generates and returns the next value in a sequence.
#
# Arguments:
# name: (Symbol)
# The name of the sequence that a value should be generated for.
#
# Returns:
# The next value in the sequence. (Object)
#
# source://factory_bot//lib/factory_bot/syntax/methods.rb#113
def generate(name); end
# Generates and returns the list of values in a sequence.
#
# Arguments:
# name: (Symbol)
# The name of the sequence that a value should be generated for.
# count: (Fixnum)
# Count of values
#
# Returns:
# The next value in the sequence. (Object)
#
# source://factory_bot//lib/factory_bot/syntax/methods.rb#127
def generate_list(name, count); end
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#27
def null(name, *traits_and_overrides, &block); end
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#35
def null_list(name, amount, *traits_and_overrides, &block); end
# source://factory_bot//lib/factory_bot/strategy_syntax_method_registrar.rb#50
def null_pair(name, *traits_and_overrides, &block); end
end
# @api private
#
# source://factory_bot//lib/factory_bot/syntax_runner.rb#3
class FactoryBot::SyntaxRunner
include ::FactoryBot::Syntax::Methods
end
# @api private
#
# source://factory_bot//lib/factory_bot/trait.rb#3
class FactoryBot::Trait
# @api private
# @return [Trait] a new instance of Trait
#
# source://factory_bot//lib/factory_bot/trait.rb#6
def initialize(name, &block); end
# @api private
#
# source://factory_bot//lib/factory_bot/trait.rb#24
def ==(other); end
# source://factory_bot//lib/factory_bot/trait.rb#17
def add_callback(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/trait.rb#17
def attributes(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/trait.rb#17
def callbacks(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/trait.rb#17
def constructor(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/trait.rb#17
def declare_attribute(*_arg0, **_arg1, &_arg2); end
# source://factory_bot//lib/factory_bot/trait.rb#17
def define_trait(*_arg0, **_arg1, &_arg2); end
# @api private
#
# source://factory_bot//lib/factory_bot/trait.rb#4
def definition; end
# @api private
#
# source://factory_bot//lib/factory_bot/trait.rb#4
def name; end
# @api private
#
# source://factory_bot//lib/factory_bot/trait.rb#20
def names; end
# source://factory_bot//lib/factory_bot/trait.rb#17
def to_create(*_arg0, **_arg1, &_arg2); end
protected
# @api private
#
# source://factory_bot//lib/factory_bot/trait.rb#31
def block; end
end
# Raised when a trait is defined that references itself.
#
# source://factory_bot//lib/factory_bot/errors.rb#6
class FactoryBot::TraitDefinitionError < ::RuntimeError; end
# source://factory_bot//lib/factory_bot/version.rb#2
FactoryBot::VERSION = T.let(T.unsafe(nil), String)