How can I use break in a loop using pry-debugger , which has a break function?
break
pry-debugger
10.times do |i| break if i > 2 end
This code will fail with an ArgumentError: Cannot identify arguments as breakpoint error.
ArgumentError: Cannot identify arguments as breakpoint
Instead of break you can use break() . The brackets help the ruby ββdistinguish between the pry-debugger break and the ruby ββbreak break() function. Then your code will look like this:
break()
10.times do |i| break() if i > 2 end
Source: https://habr.com/ru/post/982921/More articles:Synchronous and asynchronous terminology when it comes to sockets - c ++What is the recommended directory layout for third-party static files in Django projects? - javascriptRails server does not start - Could not find gem error - ruby ββ| fooobar.comCreating multiple properties with the same getters and setters - javascripthow to call a specific platform page from xamarin.forms - c #Actual default linker script and gcc settings - gccUsing web browsing to view photo galleries - androidJavaMail reads recent unread emails using IMAP - javaWhy does a bunch of JVMs continue to grow? - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/982926/adding-items-to-a-list-if-its-not-a-function&usg=ALkJrhg-TlT52R4syXGwHCxXmh_6C-1fcQAll Articles