Skip to content

Instantly share code, notes, and snippets.

@guilhermesilveira
Created March 25, 2011 19:00
Show Gist options
  • Save guilhermesilveira/887391 to your computer and use it in GitHub Desktop.
Save guilhermesilveira/887391 to your computer and use it in GitHub Desktop.
show me how coupled I am
class BasicObject
def self.accept(who)
![BasicObject, ::Object, ::Kernel, ::Module, ::Enumerable, ::Comparable, ::Struct].include?(who)
end
def self.include(*types)
self.ancestors.each do |my|
types.each { |m|
m.ancestors.each { |k|
puts "\"#{k}\" -- \"#{m}\"" if accept(k) && accept(m) && k!=m
puts "\"#{my}\" -- \"#{k}\"" if accept(k) && accept(my) && k!=my
}
}
end
super(*types)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment