added example 8.1 in Ruby