Created
November 27, 2012 20:46
-
-
Save m3nd3s/4156898 to your computer and use it in GitHub Desktop.
Hackin example
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
# Parâmetros armazenados em um array | |
a = [1, 2] | |
# Método a ser chamado | |
class Hackin | |
def self.teste(p1, p2) | |
puts "Param1: #{p1}" | |
puts "Param2: #{p2}" | |
end | |
end | |
# Chamada via métodos send, :send é o método que está sendo chamado | |
Hackin.send(:teste, *a) | |
puts "-" * 10 | |
# Ou normalmente | |
Hackin.teste(*a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment