Skip to content

Instantly share code, notes, and snippets.

@qcam
Created May 2, 2014 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qcam/11466882 to your computer and use it in GitHub Desktop.
Save qcam/11466882 to your computer and use it in GitHub Desktop.
How to call a symbol method in Ruby

How to call a symbol method in Ruby

class Klass
  def hello(*args)
    "Hello " + args.join(' ')
  end
end
k = Klass.new
k.send :hello, "gentle", "readers"   #=> "Hello gentle readers"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment