Class: Pelusa::Lint::ManyArguments
- Inherits:
-
Object
- Object
- Pelusa::Lint::ManyArguments
- Defined in:
- lib/pelusa/lint/many_arguments.rb
Instance Method Summary collapse
- #check(klass) ⇒ Object
-
#initialize ⇒ ManyArguments
constructor
A new instance of ManyArguments.
Constructor Details
#initialize ⇒ ManyArguments
Returns a new instance of ManyArguments.
4 5 6 |
# File 'lib/pelusa/lint/many_arguments.rb', line 4 def initialize @violations = Set.new end |
Instance Method Details
#check(klass) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/pelusa/lint/many_arguments.rb', line 8 def check(klass) initialize iterate_lines!(klass) return SuccessfulAnalysis.new(name) if @violations.empty? FailedAnalysis.new(name, formatted_violations) do |violations| "Methods with more than #{limit} arguments: #{violations.join(', ')}" end end |