Class: XDry::ItemPatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/xdry/patching/item_patchers.rb

Direct Known Subclasses

MethodPatcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(patcher) {|@item| ... } ⇒ ItemPatcher

Returns a new instance of ItemPatcher.

Yields:



9
10
11
12
13
# File 'lib/xdry/patching/item_patchers.rb', line 9

def initialize patcher
  @patcher = patcher
  find!
  yield @item if block_given? && found?
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



6
7
8
# File 'lib/xdry/patching/item_patchers.rb', line 6

def item
  @item
end

#patcherObject (readonly)

Returns the value of attribute patcher.



7
8
9
# File 'lib/xdry/patching/item_patchers.rb', line 7

def patcher
  @patcher
end

Instance Method Details

#found?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/xdry/patching/item_patchers.rb', line 15

def found?
  not item.nil?
end