勢いで作りました。
require 'scottie' require 'type_constraints' TypeConstraints.setup do subtype :NotNgWord, :String do constraint -> v { v !~ /悪/ } end end class Person has name: :NotNgWord, twitter_acount: :String end # ok person = Person.new person.name = "ひさいち" person.twitter_acount = "hisaichi5518" # throw exception # person.name = "悪魔ちゃん" # person.twitter_acount = :hisaichi5518 # ok p person.name #=> "ひさいち" p person.twitter_acount #=> "hisaichi5518"