class Danger::Comment
Attributes
Public Class Methods
Source
# File lib/danger/helpers/comment.rb, line 11 def self.from_github(comment) self.new(comment["id"], comment["body"]) end
Source
# File lib/danger/helpers/comment.rb, line 15 def self.from_gitlab(comment) if comment.respond_to?(:id) && comment.respond_to?(:body) type = comment.respond_to?(:type) ? comment.type : nil self.new(comment.id, comment.body, type == "DiffNote") else self.new(comment["id"], comment["body"], comment["type"] == "DiffNote") end end
Source
# File lib/danger/helpers/comment.rb, line 5 def initialize(id, body, inline = nil) @id = id @body = body @inline = inline end
Public Instance Methods
Source
# File lib/danger/helpers/comment.rb, line 24 def generated_by_danger?(danger_id) body.include?("\"generated_by_#{danger_id}\"") end
Source
# File lib/danger/helpers/comment.rb, line 28 def inline? @inline.nil? ? body.include?("") : @inline end