Posts Tagged ‘rails’

Working as a Rails Contributor


2011
08.03

Finally, I got the time to write something about my Rails Contributions. I have started contributing in April 2011. In start i usually do some test cases fixes and some updates.

After sometime i found that if you are using JRuby as a platform then you need to customize your template after generation. Or you need to use some custom template with -m option to customize your application.

I started digging into the Rails code base and i found that it can be added easily. Then… I just added and my pull request got accepted. wOOOttt!!

But that for master that means the feature will come in Rails 3.1 so after that i done some commits into 3-0-stable branch and yeah.. that feature is coming in Rails 3.0.10.

It’s really great to talking those guys on github. Specially when they ask you to change something which you have written wrong.

After that i started contributing in Rails more and more. It helps me to understand internal code and the basics of Ruby.

In recent we organized two bugmashs and we were the part of global Rails Hackfest. It was really very good. Enjoyed. Learnt a lot.

I am a part of BangaloreRubyUserGroup which helps a lot.

 

Cheers,

Arun

@arunagw

Method Visibility: Public, Protected, Private


2010
10.25

Instance methods may be publicprivate, or protected.

Methods are normally public unless they are explicitly declared to be private or protected. One exception is the initialize method, which is always implicitly private. Another exception is any “global” method declared outside of a class definition—those methods are defined as private instance methods of Object. A public method can be invoked from anywhere—there are no restrictions on its use.

A private method is internal to the implementation of a class, and it can only be called by other instance methods of the class (or, as we’ll see later, its subclasses). Private methods are implicitly invoked on self, and may not be explicitly invoked on an object. If m is a private method, then you must invoke it in functional style as m. You cannot write o.m or even self.m.

A protected method is like a private method in that it can only be invoked from within the implementation of a class or its subclasses. It differs from a private method in that it may be explicitly invoked on any instance of the class, and it is not restricted to implicit invocation on self. A protected method can be used, for example, to define an accessor that allows instances of a class to share internal state with each other, but does not allow users of the class to access that state.