Class: YARP::BreakNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::BreakNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘break` keyword.
break foo
^^^^^^^^^
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
attr_reader arguments: Node?.
-
#keyword_loc ⇒ Object
readonly
attr_reader keyword_loc: Location.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(arguments, keyword_loc, location) ⇒ BreakNode
constructor
def initialize: (arguments: Node?, keyword_loc: Location, location: Location) -> void.
-
#keyword ⇒ Object
def keyword: () -> String.
Constructor Details
#initialize(arguments, keyword_loc, location) ⇒ BreakNode
def initialize: (arguments: Node?, keyword_loc: Location, location: Location) -> void
726 727 728 729 730 |
# File 'lib/yarp/node.rb', line 726 def initialize(arguments, keyword_loc, location) @arguments = arguments @keyword_loc = keyword_loc @location = location end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
attr_reader arguments: Node?
720 721 722 |
# File 'lib/yarp/node.rb', line 720 def arguments @arguments end |
#keyword_loc ⇒ Object (readonly)
attr_reader keyword_loc: Location
723 724 725 |
# File 'lib/yarp/node.rb', line 723 def keyword_loc @keyword_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
733 734 735 |
# File 'lib/yarp/node.rb', line 733 def accept(visitor) visitor.visit_break_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
739 740 741 |
# File 'lib/yarp/node.rb', line 739 def child_nodes [arguments] end |
#deconstruct_keys(keys) ⇒ Object
747 748 749 |
# File 'lib/yarp/node.rb', line 747 def deconstruct_keys(keys) { arguments: arguments, keyword_loc: keyword_loc, location: location } end |
#keyword ⇒ Object
def keyword: () -> String
752 753 754 |
# File 'lib/yarp/node.rb', line 752 def keyword keyword_loc.slice end |