# File lib/facets/more/typecast.rb, line 121 def cast_from(object) method_to = "to_#{self.name.methodize}".to_sym if object.respond_to? method_to retval = object.send(method_to) return retval end method_from = "from_#{object.class.name.methodize}".to_sym if respond_to? method_from retval = send(method_from, object) return retval end raise TypeCastException, "TypeCasting from #{object.class.name} to #{self.name} not supported" end