On Aug 10, 1:17 pm, Michael Lang <[email protected]> wrote: > > class Sequel::Dataset > > def geta(*a) > > select(*a).first.values_at(*a) > > end > > end > > > Well, that's interesting in of itself. What does it mean to define a > > method with an * preceding the parameter's name? (Ruby novice question, I > suppose!)
It means the method can take any number of arguments, which are packed into an array (a in this case). Calling *a later takes the array and unpacks it, so it's the equivalent of calling select and values_at with the same arguments you passed to geta. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
