Class: Pelusa::FailedAnalysis
- Defined in:
- lib/pelusa/analysis.rb
Overview
Public: A FailedAnalysis is an analysis that has failed a particular lint check.
Instance Method Summary collapse
-
#initialize(name, payload, &block) ⇒ FailedAnalysis
constructor
Public: Initializes a new FailedAnalysis.
-
#message ⇒ Object
Public: Generates an explicative message yielding the payload object to the block, so that the user gets some hint to fix the problem.
-
#successful? ⇒ Boolean
Public: A failed analysis is never successful , obviously.
Methods inherited from Analysis
Constructor Details
#initialize(name, payload, &block) ⇒ FailedAnalysis
Public: Initializes a new FailedAnalysis.
name - The name of the lint check. payload - An object to use in the message to aid the user in fixing the
problem.
block - A block to generate the message. It must yield the payload
object.
67 68 69 70 71 |
# File 'lib/pelusa/analysis.rb', line 67 def initialize(name, payload, &block) super(name) @payload = payload @block = block end |
Instance Method Details
#message ⇒ Object
Public: Generates an explicative message yielding the payload object to the block, so that the user gets some hint to fix the problem.
Returns the String message.
84 85 86 |
# File 'lib/pelusa/analysis.rb', line 84 def @block.call(@payload) end |
#successful? ⇒ Boolean
Public: A failed analysis is never successful , obviously.
Returns false.
76 77 78 |
# File 'lib/pelusa/analysis.rb', line 76 def successful? false end |