Class: YARP::CallNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::CallNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a method call, in all of the various forms that can take.
foo
^^^
foo()
^^^^^
+foo
^^^^
foo +
^^^^^^^^^
foo.
^^^^^^^
foo&.
^^^^^^^^
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
attr_reader arguments: Node?.
-
#block ⇒ Object
readonly
attr_reader block: Node?.
-
#closing_loc ⇒ Object
readonly
attr_reader closing_loc: Location?.
-
#flags ⇒ Object
readonly
attr_reader flags: Integer.
-
#message_loc ⇒ Object
readonly
attr_reader message_loc: Location?.
-
#name ⇒ Object
readonly
attr_reader name: String.
-
#opening_loc ⇒ Object
readonly
attr_reader opening_loc: Location?.
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location?.
-
#receiver ⇒ Object
readonly
attr_reader receiver: Node?.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#closing ⇒ Object
def closing: () -> String?.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(receiver, operator_loc, message_loc, opening_loc, arguments, closing_loc, block, flags, name, location) ⇒ CallNode
constructor
def initialize: (receiver: Node?, operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: Node?, closing_loc: Location?, block: Node?, flags: Integer, name: String, location: Location) -> void.
-
#message ⇒ Object
def message: () -> String?.
-
#opening ⇒ Object
def opening: () -> String?.
-
#operator ⇒ Object
def operator: () -> String?.
Constructor Details
#initialize(receiver, operator_loc, message_loc, opening_loc, arguments, closing_loc, block, flags, name, location) ⇒ CallNode
def initialize: (receiver: Node?, operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: Node?, closing_loc: Location?, block: Node?, flags: Integer, name: String, location: Location) -> void
805 806 807 808 809 810 811 812 813 814 815 816 |
# File 'lib/yarp/node.rb', line 805 def initialize(receiver, operator_loc, , opening_loc, arguments, closing_loc, block, flags, name, location) @receiver = receiver @operator_loc = operator_loc = @opening_loc = opening_loc @arguments = arguments @closing_loc = closing_loc @block = block @flags = flags @name = name @location = location end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
attr_reader arguments: Node?
790 791 792 |
# File 'lib/yarp/node.rb', line 790 def arguments @arguments end |
#block ⇒ Object (readonly)
attr_reader block: Node?
796 797 798 |
# File 'lib/yarp/node.rb', line 796 def block @block end |
#closing_loc ⇒ Object (readonly)
attr_reader closing_loc: Location?
793 794 795 |
# File 'lib/yarp/node.rb', line 793 def closing_loc @closing_loc end |
#flags ⇒ Object (readonly)
attr_reader flags: Integer
799 800 801 |
# File 'lib/yarp/node.rb', line 799 def flags @flags end |
#message_loc ⇒ Object (readonly)
attr_reader message_loc: Location?
784 785 786 |
# File 'lib/yarp/node.rb', line 784 def end |
#name ⇒ Object (readonly)
attr_reader name: String
802 803 804 |
# File 'lib/yarp/node.rb', line 802 def name @name end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location?
787 788 789 |
# File 'lib/yarp/node.rb', line 787 def opening_loc @opening_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location?
781 782 783 |
# File 'lib/yarp/node.rb', line 781 def operator_loc @operator_loc end |
#receiver ⇒ Object (readonly)
attr_reader receiver: Node?
778 779 780 |
# File 'lib/yarp/node.rb', line 778 def receiver @receiver end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
819 820 821 |
# File 'lib/yarp/node.rb', line 819 def accept(visitor) visitor.visit_call_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
825 826 827 |
# File 'lib/yarp/node.rb', line 825 def child_nodes [receiver, arguments, block] end |
#closing ⇒ Object
def closing: () -> String?
853 854 855 |
# File 'lib/yarp/node.rb', line 853 def closing closing_loc&.slice end |
#deconstruct_keys(keys) ⇒ Object
833 834 835 |
# File 'lib/yarp/node.rb', line 833 def deconstruct_keys(keys) { receiver: receiver, operator_loc: operator_loc, message_loc: , opening_loc: opening_loc, arguments: arguments, closing_loc: closing_loc, block: block, flags: flags, name: name, location: location } end |
#message ⇒ Object
def message: () -> String?
843 844 845 |
# File 'lib/yarp/node.rb', line 843 def &.slice end |
#opening ⇒ Object
def opening: () -> String?
848 849 850 |
# File 'lib/yarp/node.rb', line 848 def opening opening_loc&.slice end |
#operator ⇒ Object
def operator: () -> String?
838 839 840 |
# File 'lib/yarp/node.rb', line 838 def operator operator_loc&.slice end |