Class: Gollum::Git::Actor
- Inherits:
-
Object
- Object
- Gollum::Git::Actor
- Defined in:
- lib/rugged_adapter/git_layer_rugged.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#time ⇒ Object
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, email, time = nil) ⇒ Actor
constructor
A new instance of Actor.
- #output(time) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(name, email, time = nil) ⇒ Actor
Returns a new instance of Actor.
40 41 42 43 44 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 40 def initialize(name, email, time = nil) @name = name @email = email @time = time end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
34 35 36 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 34 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
34 35 36 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 34 def name @name end |
#time ⇒ Object
Returns the value of attribute time.
34 35 36 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 34 def time @time end |
Class Method Details
.default_actor ⇒ Object
36 37 38 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 36 def self.default_actor self.new("Gollum", "Gollum@wiki") end |
Instance Method Details
#output(time) ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 46 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_h ⇒ Object
57 58 59 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 57 def to_h {:name => @name, :email => @email, :time => @time} end |