Class: XDry::InsertionPoint
- Inherits:
-
Object
- Object
- XDry::InsertionPoint
- Defined in:
- lib/xdry/patching/insertion_points.rb
Direct Known Subclasses
AfterDefineIP, BeforeImplementationStartIP, BeforeInterfaceEndIP, BeforeReturnIP, BeforeSuperCallIP, ImplementationStartIP, InsideConstructorIfSuperIP, MultiIP
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #found? ⇒ Boolean
-
#initialize ⇒ InsertionPoint
constructor
A new instance of InsertionPoint.
- #insert(patcher, lines) ⇒ Object
Constructor Details
#initialize ⇒ InsertionPoint
Returns a new instance of InsertionPoint.
8 9 10 |
# File 'lib/xdry/patching/insertion_points.rb', line 8 def initialize find! end |
Instance Attribute Details
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
6 7 8 |
# File 'lib/xdry/patching/insertion_points.rb', line 6 def ip @ip end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/xdry/patching/insertion_points.rb', line 6 def method @method end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
6 7 8 |
# File 'lib/xdry/patching/insertion_points.rb', line 6 def node @node end |
Instance Method Details
#found? ⇒ Boolean
17 18 19 |
# File 'lib/xdry/patching/insertion_points.rb', line 17 def found? not @method.nil? end |
#insert(patcher, lines) ⇒ Object
12 13 14 15 |
# File 'lib/xdry/patching/insertion_points.rb', line 12 def insert patcher, lines raise StandardError, "#{self.class.name} has not been found but trying to insert" unless found? patcher.send(@method, @node.pos, wrap(lines), @indent) end |