Update example.rb

Added example of getResultAsArray method