change the output on the fly with the %s format flag and %:
hi = "Hello, %s" puts hi % "Tom!" # => "Hello, Tom!" puts hi % "people!" # => "Hello, people!" puts hi % "universe!" # => "Hello, universe!"