lib/inch/evaluation/role/method.rb in inch-0.1.4 vs lib/inch/evaluation/role/method.rb in inch-0.2.0
- old
+ new
@@ -1,48 +1,79 @@
module Inch
module Evaluation
module Role
module Method
+ # Role assigned to methods without parameters
class WithoutParameters < Base
end
+
+ # Role assigned to methods with many parameters
+ #
+ # @see CodeObject::Proxy::MethodObject#has_many_parameters?
class WithManyParameters < Base
- # +priority
def priority
+2
end
end
+
+ # Role assigned to methods where the return value is typed in the docs
+ class WithReturnType < Base
+ end
+
+ # Role assigned to methods where the return value is not typed
+ class WithoutReturnType < Missing
+ def suggestion
+ "Describe what '#{object.name}' returns"
+ end
+ end
+
+ # Role assigned to methods where the return value is decribed in the docs
+ class WithReturnDescription < Base
+ end
+
+ # Role assigned to methods where the return value is not decribed
+ class WithoutReturnDescription < Missing
+ def suggestion
+ "Describe what '#{object.name}' returns"
+ end
+ end
+
+
+ # Role assigned to methods with many lines
+ #
+ # @see CodeObject::Proxy::MethodObject#has_many_lines?
class WithManyLines < Base
- # +priority
def priority
+2
end
end
+
+ # Role assigned to methods whose name end in a '!'
class WithBangName < Base
- # +priority
def priority
+3
end
end
+
+ # Role assigned to methods whose name end in a '?'
class WithQuestioningName < Base
def priority
-4
end
end
+
+ # Role assigned to methods which are aliased
class HasAlias < Base
- # +priority
def priority
+2
end
end
- class WithReturnType < Base
+ # Role assigned to methods that are constructors
+ class Constructor < Base
end
- class WithoutReturnType < Missing
- def suggestion
- "Describe what '#{object.name}' returns"
- end
- end
+ # Role assigned to methods that are overriding another method
class Overridden < Base
# It seems more important to document the overridden method,
# than the overriding one
def priority
-2