Is it possible to call next from within a method for an outer loop:
bot.rb
while Option.daemon_active?(daemon: "bot")
.....
Trade.market_order
....
end
trade.rb
class Trade
def self.market_order
... complex code ...
response = exchange.market_sell
next if response["state"] == false # This fails. This should start new iteration of while in bot.rb
end
end
There is quite similar question, but it doesn't seem to suit me: call next on ruby loop from external method