Sign up or Sign in | Share
 
ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby basics (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby basics
#4595
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Public Methods


: Methods are normally public unless they are explicitly declared to be private or protected.

A public method can be invoked from anywhere, there are no restrictions on its use.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4596
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Private Methods

A private method is internal to the implementation of a class, and it can only be called by other instance methods of the same class
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4597
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Protected Methods

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
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4598
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Instance methods may be public, private, or protected.


These methods can be declared with three methods named public, private, and protected
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4599
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
we have to remember that the public, private, and protected apply only to methods in Ruby.

Instance and class variables are encapsulated and effectively private, and constants are effectively public.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4600
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Subclassing and Inheritance

Most object-oriented programming languages, including Ruby, provide a sub classing mechanism that allows us to create new classes whose behavior is based on, but modified from, the behavior of an existing class.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved