Sample codes in ruby.