Skip to content

Instantly share code, notes, and snippets.

@smathy
Last active September 29, 2015 20:19
Show Gist options
  • Save smathy/98159c7cea44e97b33c1 to your computer and use it in GitHub Desktop.
Save smathy/98159c7cea44e97b33c1 to your computer and use it in GitHub Desktop.
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