What are the restrictions for method names in Ruby?

前端 未结 5 1114
甜味超标
甜味超标 2020-11-27 16:03

For example, I found the method name bundler? in the following snippet, and don\'t know whether the ? character is a specialized keyword or just pa

5条回答
  •  我在风中等你
    2020-11-27 16:10

    The characters allowed are: a-Z,, 0-9 as long as not at the beginning, _, and ? (for boolean functions) and ! (for destructive functions) and = (for setters).

提交回复
热议问题