Class: LibRubyParser::Nodes::Optarg
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Optarg
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents optional positional argument (i.e. foo
in m(foo = 1)
)
Instance Attribute Summary collapse
-
#default ⇒ Node
readonly
Default value of the argument.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#name ⇒ String
readonly
Name of the argument.
-
#name_l ⇒ Loc
readonly
Location of the argument name.
-
#operator_l ⇒ Loc
readonly
Location of the
=
operator.
Instance Attribute Details
#default ⇒ Node (readonly)
Default value of the argument
3101 3102 3103 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3101 def default @default end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
def m(foo = 1); end
~~~~~~~
3128 3129 3130 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3128 def expression_l @expression_l end |
#name ⇒ String (readonly)
Name of the argument
3097 3098 3099 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3097 def name @name end |
#name_l ⇒ Loc (readonly)
Location of the argument name
def m(foo = 1); end
~~~
3110 3111 3112 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3110 def name_l @name_l end |
#operator_l ⇒ Loc (readonly)
Location of the =
operator
def m(foo = 1); end
~
3119 3120 3121 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3119 def operator_l @operator_l end |