Class: PreCommit::Line
- Inherits:
-
Struct
- Object
- Struct
- PreCommit::Line
- Defined in:
- lib/pre-commit/line.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#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
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
2 3 4 |
# File 'lib/pre-commit/line.rb', line 2 def code @code end |
#file ⇒ Object
Returns the value of attribute file
2 3 4 |
# File 'lib/pre-commit/line.rb', line 2 def file @file end |
#line ⇒ Object
Returns the value of attribute line
2 3 4 |
# File 'lib/pre-commit/line.rb', line 2 def line @line end |
#message ⇒ Object
Returns the value of attribute message
2 3 4 |
# File 'lib/pre-commit/line.rb', line 2 def @message end |
Instance Method Details
#to_s ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/pre-commit/line.rb', line 4 def to_s result = .to_s unless empty? file result = "#{result}#{"\n" unless empty?(result)}#{file}" result = "#{result}:#{line}" unless empty? line result = "#{result}:#{code}" unless empty? code end result end |