lib/virtus/attribute/string.rb in virtus-0.0.3 vs lib/virtus/attribute/string.rb in virtus-0.0.4
- old
+ new
@@ -1,7 +1,8 @@
module Virtus
class Attribute
+
# Example usage
#
# class User
# include Virtus
#
@@ -14,18 +15,15 @@
# User.new(:name => :John)
#
class String < Object
primitive ::String
- # Typecast the given value to a string
+ # @see Virtus::Typecast::String.call
#
- # @param [Object]
- #
- # @return [String]
- #
# @api private
def typecast_to_primitive(value)
- value.to_s
+ Virtus::Typecast::String.call(value)
end
- end # String
- end # Attributes
-end # Virtus
+
+ end # class String
+ end # class Attribute
+end # module Virtus