class RuboCop::AST::ArgNode
the AST, making its methods available to all ‘arg` nodes within RuboCop.
This will be used in place of a plain node when the builder constructs
`kwrestarg`, `blockarg`, `shadowarg` and `forward_arg` nodes.
A node extension for `arg`, `optarg`, `restarg`, `kwarg`, `kwoptarg`,
def default?
-
(Boolean)
- whether the argument has a default value
def default? optarg_type? || kwoptarg_type? end
def default_value
-
(Node, nil)
- the default value of the argument
def default_value return unless default? node_parts[1] end
def name
-
(Symbol, nil)
- the name of the argument
def name node_parts[0] end