26 lines
532 B
Ruby
26 lines
532 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
|
|
|
|
public :name, :default_value
|
|
|
|
# Test if optarg definition intends to be used
|
|
#
|
|
# @return [Boolean]
|
|
def used?
|
|
!name.to_s.start_with?(UNDERSCORE)
|
|
end
|
|
end # Optarg
|
|
|
|
end # Meta
|
|
end # AST
|
|
end # Mutant
|