Skip to content

Instantly share code, notes, and snippets.

@freakflames29
Created April 3, 2021 15:05
Show Gist options
  • Save freakflames29/cf265dba4019791b2a9d1ff6e2ea7785 to your computer and use it in GitHub Desktop.
Save freakflames29/cf265dba4019791b2a9d1ff6e2ea7785 to your computer and use it in GitHub Desktop.
passing symbols as an argument to a function which calls the same name function as the symbol name
def set_name
puts "Your name is good"
end
def before_action (func)
method(func).call
end
before_action :set_name
# it is a normal ruby code which takes symbols and call the same name function as symbol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment