john peter
2006-Apr-03 19:18 UTC
[Rails] documentation question (ri and binding vs. get_binding vd getBinding)
I was reading up on ERB documentation and a snippet on rhtml requiring the use of Object.get_binding caught my attention: ... rhtml = ERB.new("someTemplate") rhtml.run(someObject.get_binding) ... Curious about tools I have at my disposal to learn more about things I don''t know about Ruby, i typed the following into my DOS console: ri get_binding and got the following disappointing message: Nothing known about get_binding Since I know that Object "inherits" from Kernel, I did an ri Kernel, and saw the documentation for binding, which referred me to the Binding class for more info. With those steps, I got a better understanding of binding, BUT i do have the following questions: (1) where did the get prefix convention come from? (2) how would a newbie know that the get prefix is required (i''m assuming it is because the code examples would have said something else otherwise?) (3) where else does this "convention" apply to? also, i noticed that ri as it''s currently setup in my environment (ruby 1.8.4 RC1 for Windows, Rails 1.1) only provides info on Ruby classes, modules, and methods and provides no help at all for Rails stuff. I do know about http://api.rubyonrails.com, BUT i was just wondering: (4) is there anything I can do to get Rails usage help within my local environment? finally, i come from a java background and java IDEs have matured to a point where i can get code assists and follow links to classes and methods to get contextual help on those classes and methods. For Ruby, I''ve been using RADRails but it doesn''t seem to offer a lot of such conveniences (other than making ri available within the IDE). So my final question is: (5) what tools can you recommend for a Ruby/RoR on Windows environment? Thank you for any help! --------------------------------- New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/eb4260e7/attachment.html