Sha256: 0576d109f67934ea29aad65a96caf28f1511ec753d222c42576b5a1281c44a20

Contents?: true

Size: 436 Bytes

Versions: 65

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module AST
    # Common functionality for primitive numeric nodes: `int`, `float`, ...
    module NumericNode
      SIGN_REGEX = /\A[+-]/.freeze

      # Checks whether this is literal has a sign.
      #
      # @example
      #
      #   +42
      #
      # @return [Boolean] whether this literal has a sign.
      def sign?
        source.match(SIGN_REGEX)
      end
    end
  end
end

Version data entries

65 entries across 45 versions & 6 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rubocop-ast-0.4.2/lib/rubocop/ast/node/mixin/numeric_node.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rubocop-ast-0.4.2/lib/rubocop/ast/node/mixin/numeric_node.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/rubocop-ast-0.4.2/lib/rubocop/ast/node/mixin/numeric_node.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/rubocop-ast-0.4.2/lib/rubocop/ast/node/mixin/numeric_node.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/rubocop-ast-0.4.2/lib/rubocop/ast/node/mixin/numeric_node.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/rubocop-ast-0.4.2/lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.6.0 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.5.1 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.5.0 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.4.2 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.4.1 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.4.0 lib/rubocop/ast/node/mixin/numeric_node.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rubocop-ast-0.3.0/lib/rubocop/ast/node/mixin/numeric_node.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.79.0/lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.3.0 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.2.0 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.1.0 lib/rubocop/ast/node/mixin/numeric_node.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.0.3 lib/rubocop/ast/node/mixin/numeric_node.rb
rubocop-ast-0.0.2 lib/rubocop/ast/node/mixin/numeric_node.rb