class Peeek::Hook::Instance

Constants

METHOD_PREFIX

Public Instance Methods

defined?() click to toggle source

Determine if the instance method is defined in the object.

@return whether the instance method is defined in the object

# File lib/peeek/hook/instance.rb, line 23
def defined?
  @object.method_defined?(@method_name) or @object.private_method_defined?(@method_name)
end
method_prefix() click to toggle source

@attribute [r] method_prefix @return [String] method prefix for instance method. return always “#”

# File lib/peeek/hook/instance.rb, line 10
def method_prefix
  METHOD_PREFIX
end
target_method() click to toggle source

@attribute [r] target_method @return [UnboundMethod] the instance method of the object

# File lib/peeek/hook/instance.rb, line 16
def target_method
  @object.instance_method(@method_name)
end

Private Instance Methods

define_method(*args, &block) click to toggle source
# File lib/peeek/hook/instance.rb, line 48
def define_method(*args, &block)
  @object.__send__(:define_method, @method_name, *args, &block)
end