Stateful: Keep state with #dup

This commit is contained in:
Didactic Drunk 2021-06-16 15:17:14 -07:00
parent 70a1dfe2c4
commit 0b966714b6

View File

@ -105,6 +105,12 @@ module Crypto::Secret
@state = State::Wiped
end
def dup
super.tap do |obj|
obj.set_state @state
end
end
protected abstract def readwrite_impl : Nil
protected abstract def readonly_impl : Nil
protected abstract def noaccess_impl : Nil