Skip to content

Instantly share code, notes, and snippets.

@jumanjiman
Last active August 29, 2015 14:05
Show Gist options
  • Save jumanjiman/2ac4b9b05a8a9aeec2b5 to your computer and use it in GitHub Desktop.
Save jumanjiman/2ac4b9b05a8a9aeec2b5 to your computer and use it in GitHub Desktop.
meta
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