Replace implementation Bilingual Ruby if String.method_defined?(:encode) module Builder ... end else class String ... end end