Class: Mutant::AST::Meta::Send
- Inherits:
-
Object
- Object
- Mutant::AST::Meta::Send
- Includes:
- NamedChildren
- Defined in:
- lib/mutant/ast/meta.rb
Overview
Generic metadata for send nodes
Constant Summary collapse
- INDEX_ASSIGNMENT_SELECTOR =
:[]=
- ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX =
'='.freeze
Instance Method Summary collapse
-
#assignment? ⇒ Boolean
private
Test if AST node is a valid assignment target.
-
#attribute_assignment? ⇒ Boolean
private
Test if AST node is an attribute assignment?.
-
#binary_method_operator? ⇒ Boolean
private
Test for binary operator implemented as method.
-
#index_assignment? ⇒ Boolean
private
Test if AST node is an index assign.
-
#mlhs? ⇒ Boolean
private
Test if node is part of an mlhs.
Methods included from NamedChildren
Instance Method Details
#assignment? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if AST node is a valid assignment target
45 46 47 |
# File 'lib/mutant/ast/meta.rb', line 45 def assignment? index_assignment? || attribute_assignment? end |
#attribute_assignment? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if AST node is an attribute assignment?
55 56 57 |
# File 'lib/mutant/ast/meta.rb', line 55 def attribute_assignment? arguments.one? && attribute_assignment_selector? end |
#binary_method_operator? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test for binary operator implemented as method
75 76 77 |
# File 'lib/mutant/ast/meta.rb', line 75 def binary_method_operator? arguments.one? && Types::BINARY_METHOD_OPERATORS.include?(selector) end |
#index_assignment? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if AST node is an index assign
65 66 67 |
# File 'lib/mutant/ast/meta.rb', line 65 def index_assignment? arguments.length.equal?(2) && index_assignment_selector? end |
#mlhs? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if node is part of an mlhs
85 86 87 |
# File 'lib/mutant/ast/meta.rb', line 85 def mlhs? (index_assignment_selector? && arguments.one?) || (arguments.empty? && attribute_assignment_selector?) end |