Virtus can coerce structured values

Posted . Visible to the public.

Just a quick note that Virtus Show archive.org snapshot can coerce (auto-cast) structured values like collections or maps:

class Klass
  include Virtus.model

  attribute :dimensions, Hash[Symbol => Float]
  attribute :numbers, Array[Integer]
end

Check out the Virtus README Show archive.org snapshot , it's full of nice things like this!

Henning Koch
Keywords
cast, auto, enumerable
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2013-12-19 08:59)