Skip to content

Instantly share code, notes, and snippets.

View akinov's full-sized avatar
🍺
Yeah

akinov akinov

🍺
Yeah
View GitHub Profile
@akinov
akinov / 100instance.rb
Last active March 21, 2020 08:08
100日後に死ぬインスタンス
require 'date'
class Crocodile
class DeadError < StandardError; end
def initialize(born = Date.today)
@born = born
end
def move
if Date.today >= @born + 100
raise DeadError