Sha256: 4a1eac631d68508d0c66c209985c083f096555ab453a1cb6533b30f85c18e340

Contents?: true

Size: 415 Bytes

Versions: 39

Compression:

Stored size: 415 Bytes

Contents

module Danger
  class Comment
    attr_reader :id, :body

    def initialize(id, body)
      @id = id
      @body = body
    end

    def self.from_github(comment)
      self.new(comment["id"], comment["body"])
    end

    def self.from_gitlab(comment)
      self.new(comment.id, comment.body)
    end

    def generated_by_danger?(danger_id)
      body.include?("\"generated_by_#{danger_id}\"")
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
danger-5.15.0 lib/danger/helpers/comment.rb
danger-5.14.0 lib/danger/helpers/comment.rb
danger-5.13.0 lib/danger/helpers/comment.rb
danger-5.12.0 lib/danger/helpers/comment.rb
danger-5.11.1 lib/danger/helpers/comment.rb
danger-5.11.0 lib/danger/helpers/comment.rb
danger-5.10.3 lib/danger/helpers/comment.rb
danger-5.10.2 lib/danger/helpers/comment.rb
danger-5.10.1 lib/danger/helpers/comment.rb
danger-5.10.0 lib/danger/helpers/comment.rb
danger-5.9.1 lib/danger/helpers/comment.rb
danger-5.9.0 lib/danger/helpers/comment.rb
danger-5.8.2 lib/danger/helpers/comment.rb
danger-5.8.1 lib/danger/helpers/comment.rb
danger-5.8.0 lib/danger/helpers/comment.rb
danger-5.7.1 lib/danger/helpers/comment.rb
danger-5.7.0 lib/danger/helpers/comment.rb
danger-5.6.7 lib/danger/helpers/comment.rb
danger-5.6.6 lib/danger/helpers/comment.rb
danger-5.6.5 lib/danger/helpers/comment.rb