Class: ExcerptBlob

Inherits:
Linguist::FileBlob
  • Object
show all
Defined in:
lib/git-branch_stats.rb

Overview

—– Language extractor from excerpts (that are in fact positive diffs) —– This is a simple override of linguist’s file blob, it is just ‘like’ the file it references, but its contents is only an exceprt of the changed lines

Instance Method Summary collapse

Constructor Details

#initialize(path, excerpt) ⇒ ExcerptBlob

Returns a new instance of ExcerptBlob.



9
10
11
12
13
# File 'lib/git-branch_stats.rb', line 9

def initialize(path, excerpt)
  super(path)
  @data = excerpt
  @size = excerpt.bytesize
end

Instance Method Details

#dataObject



15
16
17
# File 'lib/git-branch_stats.rb', line 15

def data
  @data
end

#sizeObject



19
20
21
# File 'lib/git-branch_stats.rb', line 19

def size
  @size
end