Since this has a loop and invokes a block in that loop, can you write this in Ruby using classdef.app_method?