Updating string with new value

$min_num = 1
$max_num = 15

str = “www.github.com&offset = #{$min_num} and limit = #{$max_num}”

$min_num = 2 #new value
puts str # result is: “www.github.com&offset = 1 and limit = 15”
my expected result is: “www.github.com&offset = 2 and limit = 15”

how can i get my expected result here ?

Do you want some code that produces your expected result, or do you want to know why your expectations are incorrect?

Your other question has the same misunderstanding of how Ruby works. See my answer there.

i want some code to get my expected result