Class: TicGitNG::Comment
- Inherits:
-
Object
- Object
- TicGitNG::Comment
- Defined in:
- lib/ticgit-ng/comment.rb
Instance Attribute Summary collapse
-
#added ⇒ Object
Returns the value of attribute added.
-
#base ⇒ Object
Returns the value of attribute base.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(c, user, time = nil) ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize(c, user, time = nil) ⇒ Comment
Returns a new instance of Comment.
5 6 7 8 9 10 11 |
# File 'lib/ticgit-ng/comment.rb', line 5 def initialize( c, user, time=nil ) raise unless c @comment= c @user=user @added= time.nil? ? Time.now : time self end |
Instance Attribute Details
#added ⇒ Object
Returns the value of attribute added.
3 4 5 |
# File 'lib/ticgit-ng/comment.rb', line 3 def added @added end |
#base ⇒ Object
Returns the value of attribute base.
3 4 5 |
# File 'lib/ticgit-ng/comment.rb', line 3 def base @base end |
#comment ⇒ Object
Returns the value of attribute comment.
3 4 5 |
# File 'lib/ticgit-ng/comment.rb', line 3 def comment @comment end |
#user ⇒ Object
Returns the value of attribute user.
3 4 5 |
# File 'lib/ticgit-ng/comment.rb', line 3 def user @user end |
Class Method Details
.read(base, file_name, sha) ⇒ Object
13 14 15 16 17 |
# File 'lib/ticgit-ng/comment.rb', line 13 def self.read( base, file_name, sha ) type, date, user = file_name.split('_') new( (base.git.gblob(sha).contents rescue nil), user, Time.at(date.to_i) ) end |