class GitDiff::LineNumberRange

Attributes

number_of_lines[R]
start[R]

Public Class Methods

from_string(string) click to toggle source
# File lib/git_diff/line_number_range.rb, line 7
def self.from_string(string)
  new(*string.split(","))
end
new(start = 0, number_of_lines = 1) click to toggle source
# File lib/git_diff/line_number_range.rb, line 11
def initialize(start = 0, number_of_lines = 1)
  @start = start.to_i
  @number_of_lines = number_of_lines.to_i
end

Public Instance Methods

to_s(type) click to toggle source
# File lib/git_diff/line_number_range.rb, line 16
def to_s(type)
  "#{type}#{start},#{number_of_lines}"
end