Class: Yardstick::Rules::ExampleTag

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

Overview

Checks if method has @example tag

This applies only for public methods

Instance Attribute Summary

Attributes inherited from Yardstick::Rule

#document

Instance Method Summary collapse

Methods inherited from Yardstick::Rule

coerce, #enabled?, #initialize

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 has example tag.

Returns:

  • (Boolean)

    true if has example tag

See Also:

  • description


28
29
30
# File 'lib/yardstick/rules/example_tag.rb', line 28

def valid?
  has_tag?('example')
end

#validatable?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 method is not private and it returns something meaningful.

Returns:

  • (Boolean)

    true if method is not private and it returns something meaningful

See Also:

  • description


18
19
20
# File 'lib/yardstick/rules/example_tag.rb', line 18

def validatable?
  !api?(%w[ private ]) && tag_types('return') != %w[ undefined ]
end