Class: XDry::BeforeReturnIP
- Inherits:
-
InsertionPoint
- Object
- InsertionPoint
- XDry::BeforeReturnIP
- Defined in:
- lib/xdry/patching/insertion_points.rb
Instance Attribute Summary
Attributes inherited from InsertionPoint
Instance Method Summary collapse
- #find! ⇒ Object
-
#initialize(scope) ⇒ BeforeReturnIP
constructor
A new instance of BeforeReturnIP.
Methods inherited from InsertionPoint
Constructor Details
#initialize(scope) ⇒ BeforeReturnIP
Returns a new instance of BeforeReturnIP.
122 123 124 125 |
# File 'lib/xdry/patching/insertion_points.rb', line 122 def initialize scope @scope = scope super() end |
Instance Method Details
#find! ⇒ Object
127 128 129 130 131 132 133 134 |
# File 'lib/xdry/patching/insertion_points.rb', line 127 def find! child_node = @scope.children.find { |child| child.is_a? NReturn } if child_node.nil? before @scope.ending_node else before child_node end end |