Sha256: f83c43dff056bca36a7a36ec7d89026330fc406e89c9eff7db00770be2de52e3

Contents?: true

Size: 364 Bytes

Versions: 3

Compression:

Stored size: 364 Bytes

Contents

module GitDiff
  class LineNumberRange
    attr_reader :start, :number_of_lines

    def self.from_string(string)
      new(*string.split(","))
    end

    def initialize(start = 0, number_of_lines = 0)
      @start = start.to_i
      @number_of_lines = number_of_lines.to_i
    end

    def to_s(type)
      "#{type}#{start},#{number_of_lines}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git_diff-0.4.0 lib/git_diff/line_number_range.rb
git_diff-0.3.1 lib/git_diff/line_number_range.rb
git_diff-0.3.0 lib/git_diff/line_number_range.rb