Class: Mutant::AST::Meta::Send Private

Inherits:
Object
  • Object
show all
Includes:
NamedChildren, NodePredicates
Defined in:
lib/mutant/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

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.

'='

Instance Method Summary collapse

Methods included from NamedChildren

included

Instance Method Details

#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 a valid attribute assignment

Returns:

  • (Boolean)


35
36
37
# File 'lib/mutant/ast/meta/send.rb', line 35

def attribute_assignment?
  !Types::METHOD_OPERATORS.include?(selector) && selector.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

Returns:

  • (Boolean)


42
43
44
# File 'lib/mutant/ast/meta/send.rb', line 42

def binary_method_operator?
  Types::BINARY_METHOD_OPERATORS.include?(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

Returns:

  • (Boolean)


28
29
30
# File 'lib/mutant/ast/meta/send.rb', line 28

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

Returns:

  • (Boolean)


49
50
51
52
53
# File 'lib/mutant/ast/meta/send.rb', line 49

def receiver_possible_top_level_const?
  return false unless receiver && n_const?(receiver)

  Const.new(node: receiver).possible_top_level?
end