define_singleton_method doesn't exist in ruby 1.8.7; accommodated