class Gish::Comment

Public Class Methods

new(github_comment) click to toggle source
# File lib/gish/presentation/comment.rb, line 6
def initialize(github_comment)
  @body = github_comment.body.gsub("\r\n", "\n")
  @user = github_comment.user.login
  @id = github_comment.id
  @created_at = time_in_words(github_comment.created_at)
end

Public Instance Methods

to_s() click to toggle source
# File lib/gish/presentation/comment.rb, line 13
def to_s
  output = "\n#{@id} #{bold(@user)} commented #{@created_at}"
  output << "\n\"#{@body}\"\n"
  output
end