Last active
August 29, 2015 14:05
-
-
Save jumanjiman/2ac4b9b05a8a9aeec2b5 to your computer and use it in GitHub Desktop.
meta
This file contains hidden or 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 Blah | |
def table | |
{ | |
:dword => :read_dword, | |
:string => :read_string, | |
} | |
end | |
def read_string(a_key) | |
puts 'string' | |
end | |
def read_dword(a_key) | |
puts 'dword' | |
end | |
def doit | |
[:dword, :string].each do |key| | |
method_sym = table[key] | |
self.send(method_sym, key) | |
end | |
end | |
end | |
b = Blah.new | |
b.doit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment