Class: Metior::Git::Actor

Inherits:
Actor show all
Defined in:
lib/metior/git/actor.rb

Overview

Represents an actor in a Git source code repository, i.e. an author or committer.

Author:

  • Sebastian Staudt

Instance Attribute Summary

Attributes inherited from Actor

#authored_commits, #committed_commits, #id, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Actor

#additions, #deletions, #inspect, #modifications

Methods included from AutoIncludeVCS

included

Constructor Details

#initialize(repo, actor) ⇒ Actor

Creates a new actor instance

Parameters:

  • repo (Repository)

    The repository this actor belongs to

  • actor (Grit::Actor)

    The actor object from Grit



33
34
35
36
37
# File 'lib/metior/git/actor.rb', line 33

def initialize(repo, actor)
  super repo
  @id   = actor.email
  @name = actor.name
end

Class Method Details

.id_for(actor) ⇒ String

Returns the email address as an identifier for the given actor. Git uses email addresses as identifiers for its actors.

Parameters:

  • actor (Grit::Actor)

    The actor object from Grit

Returns:

  • (String)

     The email address of the given actor



25
26
27
# File 'lib/metior/git/actor.rb', line 25

def self.id_for(actor)
  actor.email
end