Skip to content

Instantly share code, notes, and snippets.

@carjug
Created June 22, 2015 02:48
Show Gist options
  • Save carjug/b4dfe3ce924ef0c9ac5f to your computer and use it in GitHub Desktop.
Save carjug/b4dfe3ce924ef0c9ac5f to your computer and use it in GitHub Desktop.
Grandfather Clock -- LtP 14.4
def clock some_proc
current_time.to_i.times do
some_proc.call
end
end
dong = Proc.new do
puts "DONG!!!"
end
def current_time
current_time = Time.now.hour
if current_time == 0
current_time += 12
else current_time > 12
current_time -= 12
end
end
clock(dong)
@carjug
Copy link
Author

carjug commented Jun 22, 2015

Whoops! used proc syntax instead of block syntax 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment