Class: Steep::AST::Ignore::IgnoreLine
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#raw_diagnostics ⇒ Object
readonly
Returns the value of attribute raw_diagnostics.
Instance Method Summary collapse
- #ignored_diagnostics ⇒ Object
-
#initialize(comment, diagnostics, location) ⇒ IgnoreLine
constructor
A new instance of IgnoreLine.
- #line ⇒ Object
Constructor Details
#initialize(comment, diagnostics, location) ⇒ IgnoreLine
Returns a new instance of IgnoreLine.
67 68 69 70 71 |
# File 'lib/steep/ast/ignore.rb', line 67 def initialize(comment, diagnostics, location) @comment = comment @raw_diagnostics = diagnostics @location = location end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
65 66 67 |
# File 'lib/steep/ast/ignore.rb', line 65 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
65 66 67 |
# File 'lib/steep/ast/ignore.rb', line 65 def location @location end |
#raw_diagnostics ⇒ Object (readonly)
Returns the value of attribute raw_diagnostics.
65 66 67 |
# File 'lib/steep/ast/ignore.rb', line 65 def raw_diagnostics @raw_diagnostics end |
Instance Method Details
#ignored_diagnostics ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/steep/ast/ignore.rb', line 77 def ignored_diagnostics if raw_diagnostics.empty? return :all end if raw_diagnostics.size == 1 && raw_diagnostics.fetch(0).source == "all" return :all end raw_diagnostics.map do |diagnostic| name = diagnostic[:name].source name.gsub(/\ARuby::/, "") end end |
#line ⇒ Object
73 74 75 |
# File 'lib/steep/ast/ignore.rb', line 73 def line location.start_line end |