/ Published in: Ruby
Expand |
Embed | Plain Text
def my_function( a ) puts "Hello, #{a}" return a.length end len = my_function( "Giraffe" ) puts "My secret word is #{len} long"
You need to login to post a comment.
brandonjp on 02/02/11
rails ruby function example fn
1 person have marked this snippet as a favorite
def my_function( a ) puts "Hello, #{a}" return a.length end len = my_function( "Giraffe" ) puts "My secret word is #{len} long"
You need to login to post a comment.