-
-
Save anonymous/44a631e209abe5b1ede27a8a47e55e19 to your computer and use it in GitHub Desktop.
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
# Class to model reference | |
# so we can get back to the class that represents the model | |
class ModelRefContainer | |
@@hashTable = Hash.new | |
def self.insert(modelRef, classRef) | |
@@hashTable[modelRef] = classRef | |
end | |
def self.getClass(modelRef) | |
value = @@hashTable[modelRef] | |
return value | |
end | |
def self.getModel(classRef) | |
key = @@hashTable.key(classRef) | |
return key | |
end | |
def self.showKeys | |
puts @@hashTable.keys | |
end | |
def self.showValues | |
puts @@hashTable.values | |
end | |
def self.hasModel(modelRef) | |
return @@hashTable.key?(modelRef) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment