Class: LibRubyParser::Nodes::CSend
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::CSend
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents conditional method call using ‘&.` operator
Instance Attribute Summary collapse
-
#args ⇒ ::Array<Node>
readonly
List of arguments.
-
#begin_l ⇒ Loc?
readonly
Location of the open parenthesis.
-
#dot_l ⇒ Loc
readonly
Location of the ‘&.` operator.
-
#end_l ⇒ Loc?
readonly
Location of the closing parenthesis.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#method_name ⇒ String
readonly
Name of the method, ‘String(“foo”)` for `1&.foo`.
-
#operator_l ⇒ Loc?
readonly
Location of the operator if
CSendis a part of assignment like. -
#recv ⇒ Node
readonly
Receiver of the method call, ‘Int(“1”)` for `1&.foo`.
-
#selector_l ⇒ Loc?
readonly
Location of the method name.
Instance Attribute Details
#args ⇒ ::Array<Node> (readonly)
List of arguments
“‘text foo&.bar(42) # and also setters like foo&.bar = 42 “`
879 880 881 |
# File 'lib/lib-ruby-parser/nodes.rb', line 879 def args @args end |
#begin_l ⇒ Loc? (readonly)
Location of the open parenthesis
“‘text foo&.bar(42)
~
“‘
None if there are no parentheses
910 911 912 |
# File 'lib/lib-ruby-parser/nodes.rb', line 910 def begin_l @begin_l end |
#dot_l ⇒ Loc (readonly)
Location of the ‘&.` operator
“‘text foo&.bar
~~
“‘
888 889 890 |
# File 'lib/lib-ruby-parser/nodes.rb', line 888 def dot_l @dot_l end |
#end_l ⇒ Loc? (readonly)
Location of the closing parenthesis
“‘text foo&.bar(42)
~
“‘
None if there are no parentheses
921 922 923 |
# File 'lib/lib-ruby-parser/nodes.rb', line 921 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text foo&.bar(42) ~~~~~~~~~~~~ “`
941 942 943 |
# File 'lib/lib-ruby-parser/nodes.rb', line 941 def expression_l @expression_l end |
#method_name ⇒ String (readonly)
Name of the method, ‘String(“foo”)` for `1&.foo`
869 870 871 |
# File 'lib/lib-ruby-parser/nodes.rb', line 869 def method_name @method_name end |
#operator_l ⇒ Loc? (readonly)
Location of the operator if CSend is a part of assignment like
“‘text foo&.bar = 1
~
“‘
None for a regular call.
932 933 934 |
# File 'lib/lib-ruby-parser/nodes.rb', line 932 def operator_l @operator_l end |
#recv ⇒ Node (readonly)
Receiver of the method call, ‘Int(“1”)` for `1&.foo`
865 866 867 |
# File 'lib/lib-ruby-parser/nodes.rb', line 865 def recv @recv end |
#selector_l ⇒ Loc? (readonly)
Location of the method name
“‘text foo&.bar(42)
~~~
“‘
None in a very special case when method call is implicit (i.e. ‘foo&.()`)
899 900 901 |
# File 'lib/lib-ruby-parser/nodes.rb', line 899 def selector_l @selector_l end |