Methods
Public Instance methods
eigen_eval(string <, file <, line>>) → other_obj
eigen_eval { block } → other_obj

Evaluates a string containing Ruby source code, or the given block within the context of the invoking object‘s eigenclass.

obj.eigen_eval { block } would be equivalent to obj.eigenclass.instance_eval { block }

    # File lib/metable/instance_methods.rb, line 24
24:     def eigen_eval(*args, &block)
25:       eigenclass.instance_eval(*args, &block)
26:     end
eigenclass()

Returns the invoking object‘s eigenclass.

This method is also aliased as metaclass
   # File lib/metable/instance_methods.rb, line 5
5:     def eigenclass
6:       class << self
7:         self
8:       end
9:     end
metaclass()

Alias for eigenclass

private_singleton_method(*method_ids)

Makes the invoking object‘s existing singleton methods private.

    # File lib/metable/instance_methods.rb, line 30
30:     def private_singleton_method(*method_ids)
31:       eigen_eval { private *method_ids }
32:     end
protected_singleton_method(*method_ids)

Makes the invoking object‘s existing singleton methods protected.

    # File lib/metable/instance_methods.rb, line 35
35:     def protected_singleton_method(*method_ids)
36:       eigen_eval { protected *method_ids }
37:     end
public_singleton_method(*method_ids)

Makes the invoking object‘s existing singleton methods public.

    # File lib/metable/instance_methods.rb, line 40
40:     def public_singleton_method(*method_ids)
41:       eigen_eval { public *method_ids }
42:     end
Private Instance methods
alias_singleton_method(new_id, old_id)

Makes new_id an alias of the singleton method old_id within the invoking object.

    # File lib/metable/instance_methods.rb, line 49
49:     def alias_singleton_method(new_id, old_id) # :doc:
50:       eigen_eval { alias_method new_id, old_id }
51:     end
define_private_singleton_method(symbol, method) → method
define_private_singleton_method(symbol) { block } → proc

Defines a private singleton method on the invoking object (similar to define_method).

    # File lib/metable/instance_methods.rb, line 75
75:     def define_private_singleton_method(*args, &block) # :doc:
76:       define_singleton_method(*args, &block)
77:       private_singleton_method(args.first)
78:     end
define_protected_singleton_method(symbol, method) → method
define_protected_singleton_method(symbol) { block } → proc

Defines a protected singleton method on the invoking object (similar to define_method).

    # File lib/metable/instance_methods.rb, line 87
87:     def define_protected_singleton_method(*args, &block) # :doc:
88:       define_singleton_method(*args, &block)
89:       protected_singleton_method(args.first)
90:     end
define_singleton_method(symbol, method) → method
define_singleton_method(symbol) { block } → proc

Defines a public singleton method on the invoking object (similar to define_method).

Aliased as define_public_singleton_method

    # File lib/metable/instance_methods.rb, line 62
62:     def define_singleton_method(*args, &block) # :doc:
63:       eigen_eval { define_method(*args, &block) }
64:     end