Set pass/fail to a variable

Hi - is there anyway to grab pass/fail into a variable when the test is completed?

I want to be able to send the pass/fail and description of the failure to test rail. I am not sure if I can get this information right from the test or use the output file and parse that information.

I am using the ruby bindings.

Update - we have an after (:each) method for rspec and this block of code runs before the test result is shown.
So p example.execution_result.status returns nil.