Friday, 6 September 2013

Using Ruby symbols as options

Using Ruby symbols as options

Let me start this off with, I'm very very new to Ruby.
I want to know how to use Ruby symbols (e.g. :foo) as options in functions
(and not as an option hash).
Example:
round(28.53, :floor)
get_data(:age)
How would I create a function that would accept such arguments?

No comments:

Post a Comment