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? !to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/).nil? end def palindrome? to_s == to_s.reverse end end