class Prism::Relocation::Entry
存储库中的一个条目,当其值首次被访问时,会惰性地具体化这些值。
Public Class Methods
Source
# File lib/prism/relocation.rb, line 25 def initialize(repository) @repository = repository @values = nil end
使用给定的存储库初始化一个新的条目。
Public Instance Methods
Source
# File lib/prism/relocation.rb, line 120 def comments leading_comments.concat(trailing_comments) end
获取值的领先和尾随注释。
Source
# File lib/prism/relocation.rb, line 93 def end_character_column fetch_value(:end_character_column) end
获取值的结束字符列。
Source
# File lib/prism/relocation.rb, line 61 def end_character_offset fetch_value(:end_character_offset) end
获取值的结束字符偏移。
Source
# File lib/prism/relocation.rb, line 105 def end_code_units_column fetch_value(:end_code_units_column) end
获取值的结束代码单元列,以存储库配置的编码。
Source
# File lib/prism/relocation.rb, line 73 def end_code_units_offset fetch_value(:end_code_units_offset) end
获取值的结束代码单元偏移,以存储库配置的编码。
Source
# File lib/prism/relocation.rb, line 83 def end_column fetch_value(:end_column) end
获取值的结束字节列。
Source
# File lib/prism/relocation.rb, line 41 def end_line fetch_value(:end_line) end
获取值的结束行。
Source
# File lib/prism/relocation.rb, line 51 def end_offset fetch_value(:end_offset) end
获取值的结束字节偏移。
Source
# File lib/prism/relocation.rb, line 31 def filepath fetch_value(:filepath) end
获取值的路径。
Source
# File lib/prism/relocation.rb, line 110 def leading_comments fetch_value(:leading_comments) end
获取值的领先注释。
Source
# File lib/prism/relocation.rb, line 88 def start_character_column fetch_value(:start_character_column) end
获取值的起始字符列。
Source
# File lib/prism/relocation.rb, line 56 def start_character_offset fetch_value(:start_character_offset) end
获取值的起始字符偏移。
Source
# File lib/prism/relocation.rb, line 99 def start_code_units_column fetch_value(:start_code_units_column) end
获取值的起始代码单元列,以存储库配置的编码。
Source
# File lib/prism/relocation.rb, line 67 def start_code_units_offset fetch_value(:start_code_units_offset) end
获取值的起始代码单元偏移,以存储库配置的编码。
Source
# File lib/prism/relocation.rb, line 78 def start_column fetch_value(:start_column) end
获取值的起始字节列。
Source
# File lib/prism/relocation.rb, line 36 def start_line fetch_value(:start_line) end
获取值的起始行。
Source
# File lib/prism/relocation.rb, line 46 def start_offset fetch_value(:start_offset) end
获取值的起始字节偏移。
Source
# File lib/prism/relocation.rb, line 115 def trailing_comments fetch_value(:trailing_comments) end
获取值的尾随注释。
私有实例方法
Source
# File lib/prism/relocation.rb, line 135 def fetch_value(name) values.fetch(name) do raise MissingValueError, "No value for #{name}, make sure the " \ "repository has been properly configured" end end
从条目中获取一个值,如果缺少则引发错误。
Source
# File lib/prism/relocation.rb, line 143 def values @values || (@repository.reify!; @values) end
返回存储库中的值,如有必要则具体化它们。