Ruby on Rails
Thursday, August 29, 2013
On Thursday, August 29, 2013 11:02:10 PM UTC+1, Ruby-Forum.com User wrote:
The code for the number of arguments and the part which is failing is
it "requires two arguments" do
method(:array_sum).arity.should eq 2
end
Dheeraj's code has optional arguments. In such circumstances arity will return a negative number (where -1 means that the method requires at least 0 arguments, -1 would mean a method that requires at least 1 argument etc...
Thanks Dheeraj. Quick question about the pick axe book. Have you given
a version a read back in the day? I am just wondering how beginner
friendly it is.
It was the first book on ruby I ever read
Fred
--
Posted via http://www.ruby-forum.com/.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/819a7f9d-0c58-41aa-be1e-431872cd6fae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment