Last active
September 29, 2015 20:19
-
-
Save smathy/98159c7cea44e97b33c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CoolingOffManager < Disposable::Twin | |
property :cooled_off_at | |
def skip | |
set_timestamp(Time.at 0) | |
end | |
def finish | |
set_timestamp(Time.current) | |
end | |
protected | |
def set_timestamp(timestamp) | |
self.cooled_off_at = timestamp | |
save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment