Class: Gollum::Git::Actor

Inherits:
Object
  • Object
show all
Defined in:
lib/rugged_adapter/git_layer_rugged.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, email) ⇒ Actor

Returns a new instance of Actor.



28
29
30
31
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 28

def initialize(name, email)
  @name = name
  @email = email
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



22
23
24
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 22

def email
  @email
end

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 22

def name
  @name
end

Class Method Details

.default_actorObject



24
25
26
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 24

def self.default_actor
  self.new("Gollum", "Gollum@wiki")
end

Instance Method Details

#output(time) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 33

def output(time)
  # implementation from grit
  offset = time.utc_offset / 60
  "%s <%s> %d %+.2d%.2d" % [
  @name,
  @email || "null",
  time.to_i,
  offset / 60,
  offset.abs % 60]
end

#to_hObject



44
45
46
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 44

def to_h
  {:name => @name, :email => @email}
end