lib/rbi/loc.rb in rbi-0.0.16 vs lib/rbi/loc.rb in rbi-0.0.17
- old
+ new
@@ -15,11 +15,11 @@
params(
file: T.nilable(String),
begin_line: T.nilable(Integer),
end_line: T.nilable(Integer),
begin_column: T.nilable(Integer),
- end_column: T.nilable(Integer)
+ end_column: T.nilable(Integer),
).void
end
def initialize(file: nil, begin_line: nil, end_line: nil, begin_column: nil, end_column: nil)
@file = file
@begin_line = begin_line
@@ -34,11 +34,11 @@
end
sig { returns(T.nilable(String)) }
def source
file = self.file
- return nil unless file
- return nil unless ::File.file?(file)
+ return unless file
+ return unless ::File.file?(file)
return ::File.read(file) unless begin_line && end_line
string = String.new
::File.foreach(file).with_index do |line, line_number|