Class: Pelusa::Analysis
- Inherits:
-
Object
show all
- Defined in:
- lib/pelusa/analysis.rb
Overview
Public: An Analysis the result of applying a Lint check to a class.
Examples
analysis = SuccessfulAnalysis.new("Is below 50 lines")
analysis.successful?
failure = FailedAnalysis.new("Is below 50 lines", 123) do |lines|
"There are too many lines (#{lines})"
end
failure.successful?
failure.message
Instance Method Summary
collapse
Constructor Details
#initialize(name) ⇒ Analysis
Returns a new instance of Analysis.
19
20
21
|
# File 'lib/pelusa/analysis.rb', line 19
def initialize(name)
@name = name
end
|
Instance Method Details
#failed? ⇒ Boolean
31
32
33
|
# File 'lib/pelusa/analysis.rb', line 31
def failed?
not successful?
end
|
#message ⇒ Object
35
36
37
|
# File 'lib/pelusa/analysis.rb', line 35
def message
""
end
|
#name ⇒ Object
23
24
25
|
# File 'lib/pelusa/analysis.rb', line 23
def name
@name
end
|
#status ⇒ Object
39
40
41
|
# File 'lib/pelusa/analysis.rb', line 39
def status
successful? ? "successful" : "failed"
end
|
#successful? ⇒ Boolean
27
28
29
|
# File 'lib/pelusa/analysis.rb', line 27
def successful?
raise NotImplementedError
end
|