adding factory in ruby