Class: XDry::AfterDefineIP

Inherits:
InsertionPoint show all
Defined in:
lib/xdry/patching/insertion_points.rb

Instance Attribute Summary

Attributes inherited from InsertionPoint

#ip, #method, #node

Instance Method Summary collapse

Methods inherited from InsertionPoint

#found?, #insert

Constructor Details

#initialize(scope) ⇒ AfterDefineIP

Returns a new instance of AfterDefineIP.



140
141
142
143
# File 'lib/xdry/patching/insertion_points.rb', line 140

def initialize scope
  @scope = scope
  super()
end

Instance Method Details

#find!Object



145
146
147
148
149
150
# File 'lib/xdry/patching/insertion_points.rb', line 145

def find!
  child_nodes = @scope.children.select { |child| child.is_a? NDefine }
  unless child_nodes.empty?
    after child_nodes.last
  end
end