Sha256: ccdd71244f35caea239302fd73914b764c6f320fa94c77fbb283b74efa1377b9

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

module ModulesInRenderHierarchy
  
  def self.included klass
    klass.extend ClassMethods
    klass.metaclass.alias_method_chain :include, :superclass_override
  end
  
  module ClassMethods
    def include_with_superclass_override mod
      original_superclass = superclass
      self.send :include_without_superclass_override, mod
      mod.metaclass.send :define_method, :superclass do
        original_superclass
      end
      metaclass.send :define_method, :superclass do
        mod
      end
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
view_models-1.5.6 lib/experimental/modules_in_render_hierarchy.rb