class Pry::Method::Patcher

Attributes

method[RW]

Public Class Methods

code_for(filename) click to toggle source
# File lib/pry/method/patcher.rb, line 12
def self.code_for(filename)
  @@source_cache[filename]
end
new(method) click to toggle source
# File lib/pry/method/patcher.rb, line 8
def initialize(method)
  @method = method
end

Public Instance Methods

patch_in_ram(source) click to toggle source

perform the patch

# File lib/pry/method/patcher.rb, line 17
def patch_in_ram(source)
  if method.alias?
    with_method_transaction do
      redefine source
    end
  else
    redefine source
  end
end