Creating a Function

By Hawkee on Aug 18, 2005

This is a very simple Ruby snippet that creates an unnecessary function.

def sayHello(name)
  result = "Hello, " + name
  return result

# Let's say hi
puts sayHello("Jedi Starbuck")
puts sayHello("Tarantula Malone")


Sign in to comment.
log2   -  Aug 19, 2005

It\'s pretty good, basic though, and I personally don\'t really use to many functions in Ruby, I know they help and most of the time are needed, but I seem to find ways around using two maybe even three per script

Hawkee   -  Aug 18, 2005

Click the Ruby Scripting tab at the top of the site and check the links under Ruby Links. Be sure to download Ruby on Rails and check the 15 minute demo video. It let\'s you build websites quickly.

F*U*R*B*Y*   -  Aug 18, 2005

can you actually explain what Ruby is please

Hawkee   -  Aug 18, 2005

This is just to give you an idea of what Ruby looks like.

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.