A few questions about Ruby architecture

I'm primarily a free-growing .NET developer (as you can see from the amount of posts and threads I do about .NET), but I thought it would be good to learn RoR.

That being said, I have a few questions about language architecture (Ruby) and structure (RoR):

1) In .NET, every object is derived from System, but inherits from System.Object. So when I type System. I get a list of namespaces and then those namespaces, classes and other namespaces.

Does Ruby have no such hierarchy?

2) In some cases I am not getting intellisense. For example, I wrote the class described here ( http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer ), but nothing appears in the recipient string user.email when I type "user."

Any idea why?

thank

0


source to share


5 answers


Dave Thomas (Pragmatic Programmers) has an excellent Ruby Object Model / Metaprogramming. We saw this in the local Ruby user group. The series isn't free, but it's not expensive either. You can check out the free preview to see if you think it's worth your time.

And give you an answer. Yes, everything in Ruby comes from Object. The docs can be found at http://corelib.rubyonrails.org/ . Find the Object class.



I'm not sure why you are not getting intellisense, in part because you did not specify your IDE. Maybe you can't, because you added the method dynamically and there is no way to use intellisense.

+4


source


  • If we compare .NET to Rails, then yes, there is such a hierarchy. In general, you can achieve this kind of hierarchy in any Ruby application using modules.
  • I guess it has to do with Ruby dynamics.


0


source


Ruby is pure OO language meaning that everything from classes to objects comes from the Object class.

0


source


Download NetBeans. There is full intellisense support for Ruby and Ruby on Rails.

http://www.netbeans.org/features/ruby/index.html

0


source


Intellisense support probably won't give you what you think you'll get. Since Ruby is a dynamic language, Intellisense or code completion is tricky. What you will find is that either the drop is as flooded as possible, it is possible that it will be useless. Or, in your case, there is nothing.

It's not 100% useless, but I've never found it terribly valuable.

0


source







All Articles