{% nilable = /\:\:Nil|\?$/.match(type) %}
它似乎不起作用: undefined macro method 'RegexLiteral#match' .
undefined macro method 'RegexLiteral#match'
Macros::StringLiteral 有 =~ 实例:
Macros::StringLiteral
=~
{% type = "Module::Nil" %} {% p type =~ /\:\:Nil|\?$/ %} #=> true {% type = "Module::Null" %} {% p type =~ /\:\:Nil|\?$/ %} #=> false
1 回答
Macros::StringLiteral
有=~
实例: