In Files

  • typeprof-0.21.2/lib/typeprof/code-range.rb

Class/Module Index [+]

Quicksearch

TypeProf::CodeRange

Attributes

first[R]
last[R]

Public Class Methods

from_lsp(lsp_range) click to toggle source
 
               # File typeprof-0.21.2/lib/typeprof/code-range.rb, line 63
def self.from_lsp(lsp_range)
  CodeRange.new(CodeLocation.from_lsp(lsp[:start]), CodeLocation.from_lsp(lsp[:end]))
end
            
from_rbs(rbs_loc) click to toggle source
 
               # File typeprof-0.21.2/lib/typeprof/code-range.rb, line 67
def self.from_rbs(rbs_loc)
  CodeRange.new(
    CodeLocation.new(rbs_loc.start_line, rbs_loc.start_column),
    CodeLocation.new(rbs_loc.end_line, rbs_loc.end_column),
  )
end
            
new(first, last) click to toggle source
 
               # File typeprof-0.21.2/lib/typeprof/code-range.rb, line 52
def initialize(first, last)
  @first, @last = first, last
end
            

Public Instance Methods

inspect() click to toggle source
 
               # File typeprof-0.21.2/lib/typeprof/code-range.rb, line 56
def inspect
  "%p-%p" % [@first, @last]
end
            
to_lsp() click to toggle source
 
               # File typeprof-0.21.2/lib/typeprof/code-range.rb, line 74
def to_lsp
  { start: @first.to_lsp, end
            
There is an updated format of the API docs for this version here.