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