Type coercer accepts custom classes

Example:

  class FullName
    def initialize(*names)
      @names = names
    end

    def to_s
      @names.join ' '
    end
  end

  class UserValidator
    include Lotus::Validations

    attribute :full_name, type: FullName
  end

  validator = UserValidator.new(full_name: ['Luca', 'Guidi'])
  validator.valid? # trigger coercions

  puts validator.full_name.class # => FullName
  puts validator.full_name       # => "Luca Guidi"
Merge pull request #14 from lotus/custom-coercions

Type coercer accepts custom classes