-
-
Save robhanlon22/2975121 to your computer and use it in GitHub Desktop.
shit that doesn't work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CLR | |
class MDTable | |
class << self | |
def dump | |
puts @schema | |
end | |
def word(name) | |
@schema << "word #{name};" | |
end | |
def index(tables, name) | |
@schema << "index #{tables}, #{name};" | |
end | |
private | |
def inherited(descendant) | |
descendant.instance_eval do | |
@schema = '' | |
end | |
end | |
end | |
end | |
ObjectSpace.each_object(MDTable.singleton_class).each do |klass| | |
remove_const klass.name.gsub(/^.*::/, '') if obj < MDTable | |
end | |
class Module < MDTable | |
word :generation | |
index :string, :name | |
index :guid, :mvid | |
index :guid, :encid | |
end | |
end | |
puts CLR::Module.dump | |
puts CLR::MDTable.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment