Type assertion with Ruby 2.6
With RubyVM::AST in 2.6 we can write more beautiful type-assertions:
some_arg.type!(String, Symbol) #=> will raise TypeError: some_arg should be String or Symbol, not NilClass
With RubyVM::AST in 2.6 we can write more beautiful type-assertions:
some_arg.type!(String, Symbol) #=> will raise TypeError: some_arg should be String or Symbol, not NilClass
Post a comment