Class: RuboCop::Cop::Lint::PositiveP
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Lint::PositiveP
- Defined in:
- lib/rubocop/cop/lint/positive_p.rb,
lib/rubocop/cop/lint/positive_p/version.rb
Overview
This cop checks for method call Numeric#positive?
Constant Summary collapse
- MSG =
"Do not use Numeric#positive?"
- VERSION =
"0.1.0"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.support_target_ruby_version?(version) ⇒ Boolean
22 23 24 |
# File 'lib/rubocop/cop/lint/positive_p.rb', line 22 def self.support_target_ruby_version?(version) version < 2.3 end |
Instance Method Details
#on_send(node) ⇒ Object
26 27 28 29 30 |
# File 'lib/rubocop/cop/lint/positive_p.rb', line 26 def on_send(node) return unless positive?(node) add_offense(node) end |