Class: JRuby::Lint::Finding
- Inherits:
-
Struct
- Object
- Struct
- JRuby::Lint::Finding
- Defined in:
- lib/jruby/lint/finding.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.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(*args) ⇒ Finding
constructor
A new instance of Finding.
- #to_s ⇒ Object
- #warning? ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ Finding
Returns a new instance of Finding.
3 4 5 6 7 8 9 |
# File 'lib/jruby/lint/finding.rb', line 3 def initialize(*args) args[1].map! {|x| x.to_s } if args.size > 1 if args.size > 2 && args[2].respond_to?(:file) && args[2].respond_to?(:line) args = [args[0], args[1], args[2].file, (args[2].line + 1)] end super end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file
2 3 4 |
# File 'lib/jruby/lint/finding.rb', line 2 def file @file end |
#line ⇒ Object
Returns the value of attribute line
2 3 4 |
# File 'lib/jruby/lint/finding.rb', line 2 def line @line end |
#message ⇒ Object
Returns the value of attribute message
2 3 4 |
# File 'lib/jruby/lint/finding.rb', line 2 def @message end |
#tags ⇒ Object
Returns the value of attribute tags
2 3 4 |
# File 'lib/jruby/lint/finding.rb', line 2 def @tags end |
Instance Method Details
#error? ⇒ Boolean
11 12 13 |
# File 'lib/jruby/lint/finding.rb', line 11 def error? .include?('error') end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/jruby/lint/finding.rb', line 19 def to_s "#{file}:#{line}: [#{.join(', ')}] #{}" end |
#warning? ⇒ Boolean
15 16 17 |
# File 'lib/jruby/lint/finding.rb', line 15 def warning? .include?('warning') end |