Module: Blockenspiel::Unmixer

Defined in:
lib/blockenspiel/unmixer_rubinius.rb,
lib/blockenspiel/unmixer_unimplemented.rb

Overview

:stopdoc:

Constant Summary collapse

UNIMPLEMENTED =
true

Class Method Summary collapse

Class Method Details

._reset_method_cache(obj_) ⇒ Object

Newer versions of Rubinius



77
78
79
80
81
# File 'lib/blockenspiel/unmixer_rubinius.rb', line 77

def self._reset_method_cache(obj_)  # :nodoc:
  obj_.methods.each do |name_|
    ::Rubinius::VM.reset_method_cache(name_.to_sym)
  end
end

.unmix(obj_, mod_) ⇒ Object

Unmixer stub. This throws an exception indicating the unmixer is not implemented.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/blockenspiel/unmixer_rubinius.rb', line 56

def self.unmix(obj_, mod_)  # :nodoc:
  last_super_ = @old_metaclass ? obj_.metaclass : obj_.singleton_class
  this_super_ = last_super_.direct_superclass
  while this_super_
    if (this_super_ == mod_ || this_super_.respond_to?(:module) && this_super_.module == mod_)
      _reset_method_cache(obj_)
      last_super_.superclass = this_super_.direct_superclass
      _reset_method_cache(obj_)
      return
    else
      last_super_ = this_super_
      this_super_ = this_super_.direct_superclass
    end
  end
  nil
end