How to prevent function from modifying? : <p>I have the next def:</p>

<pre><code>def get_smth
    return @mySmth
end
</code></pre>

<p>how to make that there should be no way to modify the content through it or through the object it returns?</p>

<p>I thought about getters and setters, but is it a solution?</p>
