Class: TicGit::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/ticgit/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addedObject (readonly)

Returns the value of attribute added.



4
5
6
# File 'lib/ticgit/comment.rb', line 4

def added
  @added
end

#baseObject (readonly)

Returns the value of attribute base.



4
5
6
# File 'lib/ticgit/comment.rb', line 4

def base
  @base
end

#commentObject (readonly)

Returns the value of attribute comment.



4
5
6
# File 'lib/ticgit/comment.rb', line 4

def comment
  @comment
end

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'lib/ticgit/comment.rb', line 4

def user
  @user
end