Posted By

brandonjp on 02/02/11


Tagged

rails ruby function example fn


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

WaxWing


Ruby / Rails - general function syntax example


 / Published in: Ruby
 

  1. def my_function( a )
  2. puts "Hello, #{a}"
  3. return a.length
  4. end
  5.  
  6. len = my_function( "Giraffe" )
  7. puts "My secret word is #{len} long"

Report this snippet  

You need to login to post a comment.