Class: Yardstick::Rules::ApiTag::PrivateMethod

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

Overview

Checks if private method has correct @api visibility

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 api tag is private.

Returns:

  • (Boolean)

    true if api tag is private

See Also:

  • description


89
90
91
# File 'lib/yardstick/rules/api_tag.rb', line 89

def valid?
  api?(%w[ private ])
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 method visibility is private.

Returns:

  • (Boolean)

    true method visibility is private

See Also:

  • Rule::validatable?


79
80
81
# File 'lib/yardstick/rules/api_tag.rb', line 79

def validatable?
  visibility == :private
end