Class Ruby

class StringHolder
  attr_reader :string
  def initialize(string)
    @string = string
  end
end
s1 = StringHolder.new('string')
s2 = s1.dup
s3 = s1.clone
s1.string[1] = 'p'
s2.string                                      # => "spring"
s3.string                                      # => "spring"