Class: LibRubyParser::Nodes::Optarg

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents optional positional argument (i.e. foo in m(foo = 1))

Instance Attribute Summary collapse

Instance Attribute Details

#defaultNode (readonly)

Default value of the argument

Returns:



3101
3102
3103
# File 'lib/lib-ruby-parser/nodes.rb', line 3101

def default
  @default
end

#expression_lLoc (readonly)

Location of the full expression

def m(foo = 1); end
      ~~~~~~~

Returns:



3128
3129
3130
# File 'lib/lib-ruby-parser/nodes.rb', line 3128

def expression_l
  @expression_l
end

#nameString (readonly)

Name of the argument

Returns:

  • (String)


3097
3098
3099
# File 'lib/lib-ruby-parser/nodes.rb', line 3097

def name
  @name
end

#name_lLoc (readonly)

Location of the argument name

def m(foo = 1); end
      ~~~

Returns:



3110
3111
3112
# File 'lib/lib-ruby-parser/nodes.rb', line 3110

def name_l
  @name_l
end

#operator_lLoc (readonly)

Location of the = operator

def m(foo = 1); end
          ~

Returns:



3119
3120
3121
# File 'lib/lib-ruby-parser/nodes.rb', line 3119

def operator_l
  @operator_l
end