Class: Metior::GitHub::Actor

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

Overview

Represents an actor in a GitHub 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 (Hashie::Mash)

    The actor's data parsed from the JSON API



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

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

Class Method Details

.id_for(actor) ⇒ String

Returns the GitHub login as an identifier for the given actor.

Parameters:

  • actor (Hashie::Mash)

    The actor's data parsed from the JSON API

Returns:

  • (String)

     The GitHub login of the given actor



24
25
26
# File 'lib/metior/github/actor.rb', line 24

def self.id_for(actor)
  actor.
end