class Speculation::MethodIdentifier
@private
Attributes
name[R]
namespace[R]
Public Class Methods
new(namespace, name, is_instance_method)
click to toggle source
# File lib/speculation/method_identifier.rb, line 8 def initialize(namespace, name, is_instance_method) @namespace = namespace @name = name @is_instance_method = is_instance_method end
Public Instance Methods
==(other)
click to toggle source
# File lib/speculation/method_identifier.rb, line 35 def ==(other) self.class === other && other.hash == hash end
Also aliased as: eql?
get_method()
click to toggle source
# File lib/speculation/method_identifier.rb, line 18 def get_method @is_instance_method ? @namespace.instance_method(@name) : @namespace.method(@name) end
hash()
click to toggle source
# File lib/speculation/method_identifier.rb, line 31 def hash [@namespace, @name, @is_instance_method].hash end
instance_method?()
click to toggle source
# File lib/speculation/method_identifier.rb, line 14 def instance_method? @is_instance_method end
redefine_method!(new_method)
click to toggle source
# File lib/speculation/method_identifier.rb, line 22 def redefine_method!(new_method) if @is_instance_method name = @name @namespace.class_eval { define_method(name, new_method) } else @namespace.define_singleton_method(@name, new_method) end end
to_s()
click to toggle source
# File lib/speculation/method_identifier.rb, line 41 def to_s sep = @is_instance_method ? "#" : "." "#{@namespace}#{sep}#{@name}" end
Also aliased as: inspect