Module: RuboCop::Cop::IntegerNode

Included in:
Style::NumericLiteralPrefix, Style::NumericLiterals
Defined in:
lib/rubocop/cop/mixin/integer_node.rb

Overview

Common functionality for checking integer nodes.

Instance Method Summary collapse

Instance Method Details

#integer_part(node) ⇒ Object



7
8
9
# File 'lib/rubocop/cop/mixin/integer_node.rb', line 7

def integer_part(node)
  node.source.sub(/^[+-]/, '').split('.').first
end