Created
August 18, 2017 17:15
-
-
Save dummied/a305888cc15872fbcc70765e99065e50 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.new do | |
def self.alltime_poops | |
@poops ||= [] | |
end | |
def self.stats | |
puts "You've pooped #{alltime_poops.count{ |poo| poo.timestamp.strftime("%A, %b %d") == Time.now.strftime("%A, %b %d") }} times today." | |
end | |
attr_accessor :volume, :consistency, :timestamp, :color | |
def initialize(volume:, consistency:, timestamp: Time.now, color: "Brown") | |
@volume = volume | |
@consistency = consistency | |
@timestamp = timestamp | |
@color = color | |
end | |
def evacuate | |
self.class.alltime_poops << self | |
puts "Ah. That feels better." | |
end | |
end | |
rand(200).times do | |
💩.new(volume: "medium", consistency: "loose").evacuate | |
end | |
💩.stats |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment