Skip to content

Instantly share code, notes, and snippets.

@bparanj
Created March 30, 2017 07:16
Show Gist options
  • Save bparanj/7800ca88ae006015299e6f884568c1be to your computer and use it in GitHub Desktop.
Save bparanj/7800ca88ae006015299e6f884568c1be to your computer and use it in GitHub Desktop.
Ruby Object Model Exercise #4
loop do
p 'This will print forever'
end
@bparanj
Copy link
Author

bparanj commented Mar 30, 2017

[Transcript show: 'This will repeat forever'] repeat

@tahngarth825
Copy link

class Proc
  def repeat
    self.call while true
  end
end

prc = Proc.new{ puts 'This will print forever' }

prc.repeat

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