gitlab-org--gitlab-foss/lib/gitlab/git/blob_snippet.rb

33 lines
546 B
Ruby
Raw Normal View History

2017-01-04 13:43:06 -05:00
module Gitlab
module Git
class BlobSnippet
include Linguist::BlobHelper
attr_accessor :ref
attr_accessor :lines
attr_accessor :filename
attr_accessor :startline
def initialize(ref, lines, startline, filename)
@ref, @lines, @startline, @filename = ref, lines, startline, filename
end
def data
lines.join("\n") if lines
end
def name
filename
end
def size
data.length
end
def mode
nil
end
end
end
end