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