lib/slim_lint/lint.rb in slim_lint-0.2.0 vs lib/slim_lint/lint.rb in slim_lint-0.3.0

- old
+ new

@@ -1,10 +1,23 @@ module SlimLint # Contains information about a problem or issue with a Slim document. class Lint - attr_reader :filename, :line, :linter, :message, :severity + # @return [String] file path to which the lint applies + attr_reader :filename + # @return [String] line number of the file the lint corresponds to + attr_reader :line + + # @return [SlimLint::Linter] linter that reported the lint + attr_reader :linter + + # @return [String] error/warning message to display to user + attr_reader :message + + # @return [Symbol] whether this lint is a warning or an error + attr_reader :severity + # Creates a new lint. # # @param linter [SlimLint::Linter] # @param filename [String] # @param line [Fixnum] @@ -16,9 +29,12 @@ @line = line || 0 @message = message @severity = severity end + # Return whether this lint has a severity of error. + # + # @return [Boolean] def error? @severity == :error end end end