lib/virtus/attribute/hash.rb in virtus-0.0.5 vs lib/virtus/attribute/hash.rb in virtus-0.0.6
- old
+ new
@@ -1,19 +1,21 @@
module Virtus
class Attribute
- # Example usage:
+ # Hash
#
+ # @example
# class Post
# include Virtus
#
# attribute :meta, Hash
# end
#
# Post.new(:meta => { :tags => %w(foo bar) })
#
class Hash < Object
- primitive ::Hash
- complex true
+ primitive ::Hash
+ coercion_method :to_hash
+
end # class Hash
end # class Attribute
end # module Virtus