Class: Bringit::Blame

Inherits:
Object
  • Object
show all
Includes:
EncodingHelper
Defined in:
lib/bringit/blame.rb

Constant Summary

Constants included from EncodingHelper

EncodingHelper::ENCODING_CONFIDENCE_THRESHOLD

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from EncodingHelper

#encode!, #encode_utf8

Constructor Details

#initialize(repository, sha, path) ⇒ Blame

Returns a new instance of Blame.



7
8
9
10
11
12
13
# File 'lib/bringit/blame.rb', line 7

def initialize(repository, sha, path)
  @repo = repository
  @sha = sha
  @path = path
  @lines = []
  @blames = load_blame
end

Instance Attribute Details

#blamesObject (readonly)

Returns the value of attribute blames.



5
6
7
# File 'lib/bringit/blame.rb', line 5

def blames
  @blames
end

#linesObject (readonly)

Returns the value of attribute lines.



5
6
7
# File 'lib/bringit/blame.rb', line 5

def lines
  @lines
end

Instance Method Details

#eachObject



15
16
17
18
19
20
21
22
# File 'lib/bringit/blame.rb', line 15

def each
  @blames.each do |blame|
    yield(
      Bringit::Commit.new(blame.commit, @repo),
      blame.line
    )
  end
end