Class: Danger::Helpers::CommentsHelper::Comment
- Inherits:
-
Object
- Object
- Danger::Helpers::CommentsHelper::Comment
- Defined in:
- lib/danger/helpers/comments_helper.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #generated_by_danger?(danger_id) ⇒ Boolean
-
#initialize(id, body) ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize(id, body) ⇒ Comment
Returns a new instance of Comment.
187 188 189 190 |
# File 'lib/danger/helpers/comments_helper.rb', line 187 def initialize(id, body) @id = id @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
185 186 187 |
# File 'lib/danger/helpers/comments_helper.rb', line 185 def body @body end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
185 186 187 |
# File 'lib/danger/helpers/comments_helper.rb', line 185 def id @id end |
Class Method Details
.from_github(comment) ⇒ Object
192 193 194 |
# File 'lib/danger/helpers/comments_helper.rb', line 192 def self.from_github(comment) self.new(comment[:id], comment[:body]) end |
.from_gitlab(comment) ⇒ Object
196 197 198 |
# File 'lib/danger/helpers/comments_helper.rb', line 196 def self.from_gitlab(comment) self.new(comment.id, comment.body) end |
Instance Method Details
#generated_by_danger?(danger_id) ⇒ Boolean
200 201 202 |
# File 'lib/danger/helpers/comments_helper.rb', line 200 def generated_by_danger?(danger_id) body.include?("generated_by_#{danger_id}") end |