2017-12-06 8 views
1
{% nilable = /\:\:Nil|\?$/.match(type) %} 

작동하지 않는 것 같습니다 : undefined macro method 'RegexLiteral#match'.매크로에서 정규식을 수행하는 방법?

{% type = "Module::Nil" %} 
{% p type =~ /\:\:Nil|\?$/ %} #=> true 

{% type = "Module::Null" %} 
{% p type =~ /\:\:Nil|\?$/ %} #=> false 
:

답변

3

Macros::StringLiteral

=~ 인스턴스가