Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Ruby Programming
Previous Page Home Next Page

Named Arguments

Other automation client languages such as Visual Basic have the concept of named arguments. Suppose you had a Visual Basic routine with the signature:

Song(artist, title, length):    rem Visual Basic

Instead of calling it with all three arguments in the order specified, you could use named arguments.

Song title := 'Get It On':      rem Visual Basic

This is equivalent to the call Song(nil, 'Get It On', nil).

In Ruby, you can use this feature by passing a hash with the named arguments. 'title' => 'Get It On' )
Ruby Programming
Previous Page Home Next Page

  Published under the terms of the Open Publication License Design by Interspire