Stateful: Keep state with #dup

master
Didactic Drunk 2021-06-16 15:17:14 -07:00
parent 70a1dfe2c4
commit 0b966714b6
1 changed files with 6 additions and 0 deletions

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