This Question may be weird or i am plain dumb.
>> Array.methods.count
=> 97
>> a = Array.new.methods
=> 167
What causes the increase in number of methods after an array has been initialized and assigned.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are counting two things: class-methods and instance methods. You may compare it with
instance_methodsOr take a look if
newis a valid method:newis only defined on the class, not in the instance.