class Prism::Comment
表示解析过程中遇到的注释。它是所有注释类型的基类。
属性
此注释在源代码中的位置。
公共类方法
源码
# File lib/prism/parse_result.rb, line 512 def initialize(location) @location = location end
使用给定的位置创建一个新的注释对象。
公共实例方法
源码
# File lib/prism/parse_result.rb, line 517 def deconstruct_keys(keys) { location: location } end
为 Comment
实现哈希模式匹配接口。
源码
# File lib/prism/parse_result.rb, line 522 def slice location.slice end
通过从源代码中切片来返回注释的内容。