class FactoryBot::DefinitionHierarchy

def self.add_callbacks(callbacks)

def self.add_callbacks(callbacks)
  if callbacks.any?
    define_method :callbacks do
      super() + callbacks
    end
  end
end

def self.build_constructor(&block)

def self.build_constructor(&block)
  if block
    define_method(:constructor) do
      block
    end
  end
end

def self.build_from_definition(definition)

def self.build_from_definition(definition)
  build_to_create(&definition.to_create)
  build_constructor(&definition.constructor)
  add_callbacks definition.callbacks
end

def self.build_to_create(&block)

def self.build_to_create(&block)
  if block
    define_method(:to_create) do
      block
    end
  end
end