| Module | NotCopyable |
| In: |
lib/facet/notcopyable.rb
|
Disable copying via dup and clone (and copy).
require 'carat/notcopyable.rb'
Class FixedString < String
include NotCopyable
end
s = FixedString.new("Don't tred on me!")
puts s
s2 = s.dup
produces
Don't tred on me! TypeError, "Object not copyable"
| VERSION | = | '1.0.0' |