Class: Metior::Adapter::Grit::Actor
- Inherits:
-
Metior::Actor
- Object
- Metior::Actor
- Metior::Adapter::Grit::Actor
- Defined in:
- lib/metior/adapter/grit/actor.rb
Overview
Represents an actor in a Git source code repository, i.e. an author or committer.
Instance Attribute Summary
Attributes inherited from Metior::Actor
#authored_commits, #committed_commits, #id, #name
Class Method Summary (collapse)
-
+ (String) id_for(actor)
Returns the email address as an identifier for the given actor.
Instance Method Summary (collapse)
-
- (Actor) initialize(repo, actor)
constructor
Creates a new actor instance.
Methods inherited from Metior::Actor
#additions, #deletions, #inspect, #modifications
Methods included from Metior::AutoIncludeAdapter
Constructor Details
- (Actor) initialize(repo, actor)
Creates a new actor instance
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/metior/adapter/grit/actor.rb', line 32 def initialize(repo, actor) super repo @id = actor.email @name = actor.name if @id.respond_to? :force_encoding @id.force_encoding 'utf-8' @name.force_encoding 'utf-8' end end |
Class Method Details
+ (String) id_for(actor)
Returns the email address as an identifier for the given actor.
Git uses email addresses as identifiers for its actors.
24 25 26 |
# File 'lib/metior/adapter/grit/actor.rb', line 24 def self.id_for(actor) actor.email end |