123456789_123456789_123456789_123456789_123456789_

Class: Prism::CallNode

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Node
Instance Chain:
self, Node
Inherits: Prism::Node
Defined in: lib/prism/node_ext.rb

Instance Attribute Summary

Node - Inherited

Instance Method Summary

  • #full_message_loc

    When a call node has the attribute_write flag set, it means that the call is using the attribute write syntax.

Node - Inherited

Instance Method Details

#full_message_loc

When a call node has the attribute_write flag set, it means that the call is using the attribute write syntax. This is either a method call to []= or a method call to a method that ends with =. Either way, the = sign is present in the source.

::Prism returns the message_loc without the = sign attached, because there can be any amount of space between the message and the = sign. However, sometimes you want the location of the full message including the inner space and the = sign. This method provides that.

[ GitHub ]

  
# File 'lib/prism/node_ext.rb', line 331

def full_message_loc
  attribute_write? ? message_loc&.adjoin("=") : message_loc
end