Class: Yardstick::Rules::Summary::SingleLine

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

Overview

Checks that method summary length is exactly one line

Constant Summary collapse

LINE_BREAK_CHARACTER =
"\n"

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 text does not include a new line.

Returns:

  • (Boolean)

    true if summary text does not include a new line

See Also:

  • description

81
82
83
# File 'lib/yardstick/rules/summary.rb', line 81

def valid?
  !summary_text.include?(LINE_BREAK_CHARACTER)
end