15ced2aed0
The AST::Meta was a class or two away from exceeding the rubocop ClassLength limit so this seems like a necessary reorganization.
26 lines
527 B
Ruby
26 lines
527 B
Ruby
module Mutant
|
|
module AST
|
|
# Node meta information mixin
|
|
module Meta
|
|
|
|
# Metadata for optional argument nodes
|
|
class Optarg
|
|
include NamedChildren, Concord.new(:node)
|
|
|
|
UNDERSCORE = '_'.freeze
|
|
|
|
children :name, :default_value
|
|
|
|
# Test if optarg definition intends to be used
|
|
#
|
|
# @return [Boolean]
|
|
#
|
|
# @api private
|
|
def used?
|
|
!name.to_s.start_with?(UNDERSCORE)
|
|
end
|
|
end # Optarg
|
|
|
|
end # Meta
|
|
end # AST
|
|
end # Mutant
|