# File lib/arel/algebra/attributes/attribute.rb, line 266
266: def type_cast(value)
267: if root == self
268: raise NotImplementedError, "#type_cast should be implemented in a subclass."
269: else
270: root.type_cast(value)
271: end
272: end
# File lib/arel/algebra/attributes/attribute.rb, line 274
274: def type_cast_to_numeric(value, method)
275: return unless value
276: if value.respond_to?(:to_str)
277: str = value.to_str.strip
278: return if str.empty?
279: return $1.send(method) if str =~ /\A(-?(?:0|[1-9]\d*)(?:\.\d+)?|(?:\.\d+))\z/
280: elsif value.respond_to?(method)
281: return value.send(method)
282: end
283: raise typecast_error(value)
284: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.