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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, email) ⇒ Actor
constructor
A new instance of Actor.
- #output(time) ⇒ Object
- #to_h ⇒ Object
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
#email ⇒ Object
Returns the value of attribute email.
22 23 24 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 22 def email @email end |
#name ⇒ Object
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_actor ⇒ Object
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_h ⇒ Object
44 45 46 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 44 def to_h {:name => @name, :email => @email} end |