I have a method
def method1(&block)
#.............
if condition == "yes"
yield if block_given?
{success: :true, value: **value returned from the block**}
else
{is_success: :false, value: get_errors_array() }
end
end
How do retrieve the value from &block? Should the &block use return keyword for that?