class Octaccord::Formatter::Comment

Public Class Methods

new(comment) click to toggle source
# File lib/octaccord/formatter/comment.rb, line 4
def initialize(comment)
  @resource = comment
end

Public Instance Methods

body() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 36
def body
  @resource.body
end
created_at() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 16
def created_at
  @resource.created_at.localtime
end
html_url() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 24
def html_url
  @resource.html_url
end
id() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 32
def id
  @resource.id
end
issue_url() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 28
def issue_url
  @resource.issue_url
end
references() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 40
def references
  @resource.body.scan(/#(\d+)/).map{|d| d.first.to_i}
end
summary() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 44
def summary
  lines = @resource.body.split(/\r?\n/).map{|line|
    line.sub(/^[*#]+\s+/, "")
  }.join(" ")[0,200]
end
Also aliased as: title
title()
Alias for: summary
updated_at() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 20
def updated_at
  @resource.updated_at.localtime
end
url() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 12
def url
  @resource.url
end
user() click to toggle source
# File lib/octaccord/formatter/comment.rb, line 8
def user
  User.new(@resource.user)
end