Class: Yardstick::Rules::Summary::Length

Inherits:
Yardstick::Rule show all
Defined in:
lib/yardstick/rules/summary.rb

Overview

Checks that method summary length doesn’t go over 80 characters

Constant Summary collapse

MAXIMUM_LINE_LENGTH =
80

Instance Attribute Summary

Attributes inherited from Yardstick::Rule

#document

Instance Method Summary collapse

Methods inherited from Yardstick::Rule

coerce, #enabled?, #initialize, #validatable?

Constructor Details

This class inherits a constructor from Yardstick::Rule

Instance Method Details

#valid?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if summary length is below 80 characters.

Returns:

  • (Boolean)

    true if summary length is below 80 characters

See Also:

  • description


47
48
49
# File 'lib/yardstick/rules/summary.rb', line 47

def valid?
  summary_text.split(//u).count <= MAXIMUM_LINE_LENGTH
end