Class: Mutest::AST::Meta::Send Private
- Inherits:
-
Object
- Object
- Mutest::AST::Meta::Send
- Includes:
- NamedChildren, NodePredicates
- Defined in:
- lib/mutest/ast/meta/send.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Metadata for send nodes
Constant Summary collapse
- INDEX_ASSIGNMENT_SELECTOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
:[]=- ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'='.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.
-
#proc? ⇒ Boolean
private
Test if node is defining a proc.
-
#receiver_possible_top_level_const? ⇒ Boolean
private
Test if receiver is possibly a top level constant.
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
33 34 35 |
# File 'lib/mutest/ast/meta/send.rb', line 33 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?
40 41 42 43 |
# File 'lib/mutest/ast/meta/send.rb', line 40 def attribute_assignment? !Types::METHOD_OPERATORS.include?(selector) && selector.to_s.end_with?(ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX) 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
55 56 57 |
# File 'lib/mutest/ast/meta/send.rb', line 55 def binary_method_operator? 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
48 49 50 |
# File 'lib/mutest/ast/meta/send.rb', line 48 def index_assignment? selector.equal?(INDEX_ASSIGNMENT_SELECTOR) end |
#proc? ⇒ 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 defining a proc
26 27 28 |
# File 'lib/mutest/ast/meta/send.rb', line 26 def proc? naked_proc? || proc_new? end |
#receiver_possible_top_level_const? ⇒ 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 receiver is possibly a top level constant
62 63 64 65 66 |
# File 'lib/mutest/ast/meta/send.rb', line 62 def receiver_possible_top_level_const? return false unless receiver && n_const?(receiver) Const.new(receiver).possible_top_level? end |