Instantiating Object parameters in the initialize method or the initialize method parameters

These programs are the same, except one instantiates the weapon when
instantiation the object and one instantiates the weapon the the
initialize method itself. They both work the same.

Which way is better?

class Character

def initialize(weapon)
@weapon = weapon
end
.
.
end

class King < Character
end

king = King.new(AxeBehaviour.new)

VS

class Character

def initialize(weapon)
@weapon = weapon.new
end
.
.
end

class King < Character
end

king = King.new(AxeBehaviour)

Timothy Wi wrote in post #1165108:

Which way is better?

It’s the difference between composing objects directly and passing a
factory to create needed instances. I don’t think there is a reply to
your question which is always true (other than the default “it depends”
of course).

From what you are showing I would lean towards passing individual
objects. But that is simply because it is the more usual pattern.