Class: Danger::Markdown
- Inherits:
-
Object
- Object
- Danger::Markdown
- Defined in:
- lib/danger/danger_core/messages/markdown.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(message, file = nil, line = nil) ⇒ Markdown
constructor
A new instance of Markdown.
-
#inline? ⇒ Boolean
Returns true if is a file or line, false otherwise.
- #to_s ⇒ Object
Constructor Details
#initialize(message, file = nil, line = nil) ⇒ Markdown
Returns a new instance of Markdown.
5 6 7 8 9 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 5 def initialize(, file = nil, line = nil) self. = self.file = file self.line = line end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 3 def file @file end |
#line ⇒ Object
Returns the value of attribute line.
3 4 5 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 3 def line @line end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 3 def @message end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 11 def ==(other) return false if other.nil? return false unless other.kind_of? self.class other. == && other.file == file && other.line == line end |
#eql?(other) ⇒ Boolean
28 29 30 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 28 def eql?(other) return self == other end |
#hash ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 20 def hash h = 1 h = h * 31 + .hash h = h * 17 + file.hash h = h * 17 + line.hash h end |
#inline? ⇒ Boolean
Returns true if is a file or line, false otherwise
33 34 35 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 33 def inline? file || line end |
#to_s ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/danger/danger_core/messages/markdown.rb', line 37 def to_s extra = [] extra << "file: #{file}" unless file extra << "line: #{line}" unless line "Markdown #{} { #{extra.join ', '.freeze} }" end |