class Object unless method_defined?("blank?") def blank? respond_to?(:empty?) ? !!empty? : !self end end unless method_defined?("present?") def present? !blank? end end unless method_defined?("try") def try(method) send method if respond_to? method end end def numeric? !self.to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/).nil? end def palindrome? self.to_s.reverse == self.to_s end end