Sha256: 23f22d099f4a8dfd5f26ece645bb53adfe9dc32891c441bb48e9afb587f76d4f

Contents?: true

Size: 1 KB

Versions: 13

Compression:

Stored size: 1 KB

Contents

#module MPatch::Include
#  module Module #ClassAndModule
#
#    def mixin_ancestors(include_ancestors=true)
#      ancestors.take_while {|a| include_ancestors || a != superclass }.
#          select {|ancestor| ancestor.instance_of?( ::Module ) }
#    end
#
#    def inherited_by *args
#
#      if args.empty?
#        args.push(::Class)
#        args.push(::Module)
#      end
#
#      return_array= []
#      args.each do |type_name|
#
#        ::ObjectSpace.each_object(type_name) do |candidate|
#          begin
#
#            if !return_array.include?(candidate) && candidate != self
#              case self.class.to_s
#
#                when "Module"
#                  return_array.push candidate if candidate.mixin_ancestors.include?(self)
#
#                when "Class"
#                  return_array.push candidate if candidate < self
#
#              end
#
#            end
#
#          rescue ::ArgumentError, ::NoMethodError
#          end
#        end
#
#      end
#      return_array
#
#    end
#
#  end
#end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mpatch-2.12.2 dump/class_and_module.rb
mpatch-2.12.1 dump/class_and_module.rb
mpatch-2.12.0 dump/class_and_module.rb
mpatch-2.11.0 dump/class_and_module.rb
mpatch-2.9.0 dump/class_and_module.rb
mpatch-2.8.1 dump/class_and_module.rb
mpatch-2.8.0 dump/class_and_module.rb
mpatch-2.7.0 dump/class_and_module.rb
mpatch-2.6.0 dump/class_and_module.rb
mpatch-2.5.0 dump/class_and_module.rb
mpatch-2.4.0 dump/class_and_module.rb
mpatch-2.3.0 dump/class_and_module.rb
mpatch-2.2.4 dump/class_and_module.rb