RubyFlow The Ruby and Rails community linklog

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

Gem: https://github.com/olegantonyan/typerb

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in