Class: LibRubyParser::Nodes::Send

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

Overview

Represents a method call (e.g. foo.bar(42))

Instance Attribute Summary collapse

Instance Attribute Details

#args::Array<Node> (readonly)

A list of arguments

Returns:



3744
3745
3746
# File 'lib/lib-ruby-parser/nodes.rb', line 3744

def args
  @args
end

#begin_lLoc? (readonly)

Location of open parenthesis

foo(42)
   ~

None if there are no parentheses

Returns:



3777
3778
3779
# File 'lib/lib-ruby-parser/nodes.rb', line 3777

def begin_l
  @begin_l
end

#dot_lLoc? (readonly)

Location of the . operator

foo.bar(42)
   ~

None for implicit method call (e.g. foo(42))

Returns:



3755
3756
3757
# File 'lib/lib-ruby-parser/nodes.rb', line 3755

def dot_l
  @dot_l
end

#end_lLoc? (readonly)

Location of closing parenthesis

foo(42)
      ~

None if there are no parentheses

Returns:



3788
3789
3790
# File 'lib/lib-ruby-parser/nodes.rb', line 3788

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

foo.bar(42)
~~~~~~~~~~~

Returns:



3808
3809
3810
# File 'lib/lib-ruby-parser/nodes.rb', line 3808

def expression_l
  @expression_l
end

#method_nameString (readonly)

Name of the method that is called

Returns:

  • (String)


3740
3741
3742
# File 'lib/lib-ruby-parser/nodes.rb', line 3740

def method_name
  @method_name
end

#operator_lLoc? (readonly)

Location of the operator if method is a setter

foo.bar = 42
        ~

None otherwise

Returns:



3799
3800
3801
# File 'lib/lib-ruby-parser/nodes.rb', line 3799

def operator_l
  @operator_l
end

#recvNode? (readonly)

Receiver of the method call

None for implicit method call (e.g. foo(42))

Returns:



3736
3737
3738
# File 'lib/lib-ruby-parser/nodes.rb', line 3736

def recv
  @recv
end

#selector_lLoc? (readonly)

Location of the method name

foo.bar(42)
    ~~~

None in a very special case when method call is implicit (i.e. foo.(42))

Returns:



3766
3767
3768
# File 'lib/lib-ruby-parser/nodes.rb', line 3766

def selector_l
  @selector_l
end