rubocop-hq/rubocop-ast

View on GitHub
lib/rubocop/ast/node/mixin/basic_literal_node.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module RuboCop
  module AST
    # Common functionality for primitive literal nodes: `sym`, `str`,
    # `int`, `float`, ...
    module BasicLiteralNode
      # Returns the value of the literal.
      #
      # @return [mixed] the value of the literal
      def value
        node_parts[0]
      end
    end
  end
end