Sha256: eeec1622fca1c80adae4bf9bdabb9b408f47be276fbde606536274f2e15997e4

Contents?: true

Size: 473 Bytes

Versions: 7

Compression:

Stored size: 473 Bytes

Contents

= Module#copy_inheritor

  require 'facets/module/copy_inheritor'

We see copy_inheritor

    m = Module.new do
      copy_inheritor :koko, []
      koko << 1
    end

    c1 = Class.new do
      include m
      #inheritor :koko, [], :+
      koko << 2
      koko << 3
    end

    c2 = Class.new do
      include m
      #inheritor :koko, [], :+
      koko << 4
    end

copy_inheritor

    m.koko.assert  == [1]
    c1.koko.assert == [1,2,3]
    c2.koko.assert == [1,4]

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
facets-3.0.0 demo/core/module/copy_inheritor.rdoc
facets-2.9.3 qed/core/module/copy_inheritor.rdoc
facets-2.9.2 qed/core-uncommon/module/copy_inheritor.rdoc
facets-2.9.1 qed/core-uncommon/module/copy_inheritor.rdoc
facets-2.9.0 qed/tour/module/copy_inheritor.rdoc
facets-2.9.0.pre.2 qed/tour/module/copy_inheritor.rdoc
facets-2.9.0.pre.1 qed/tour/module/copy_inheritor.rdoc