Replace methods Bilingual Ruby class Employee if String.method_defined?(:encode) def name ... end else def name ... end end end