Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby named parameters

def show_name_and_address(name="Someone", address="Somewhere")
  puts "#{name}, #{address}"
end

show_name_and_address
#=> 'Someone, Somewhere'

show_name_and_address('Andy')
#=> 'Andy, Somewhere'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ruby #named #parameters
ADD COMMENT
Topic
Name
9+3 =