Skip to content

Instantly share code, notes, and snippets.

@patrickgombert
Created February 28, 2012 04:13
Show Gist options
  • Save patrickgombert/1929384 to your computer and use it in GitHub Desktop.
Save patrickgombert/1929384 to your computer and use it in GitHub Desktop.
functional get employee name example
def get_employee(id, &block)
block.call(db_employee_find(id))
end
# To get an employee name with an id of 1
get_employee(1) { |emp| emp.get_name }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment