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



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

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