class FactoryBot::StrategyCalculator

@api private

Public Class Methods

new(name_or_object) click to toggle source
# File lib/factory_bot/strategy_calculator.rb, line 4
def initialize(name_or_object)
  @name_or_object = name_or_object
end

Public Instance Methods

strategy() click to toggle source
# File lib/factory_bot/strategy_calculator.rb, line 8
def strategy
  if strategy_is_object?
    @name_or_object
  else
    strategy_name_to_object
  end
end

Private Instance Methods

strategy_is_object?() click to toggle source
# File lib/factory_bot/strategy_calculator.rb, line 18
def strategy_is_object?
  @name_or_object.is_a?(Class)
end
strategy_name_to_object() click to toggle source
# File lib/factory_bot/strategy_calculator.rb, line 22
def strategy_name_to_object
  FactoryBot::Internal.strategy_by_name(@name_or_object)
end