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
#4391
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  
Ruby Local Variables


Local variables begin with a lowercase letter or _.

The scope of a local variable ranges from class, module, def, or do to the corresponding end or from a block's opening brace to its close brace {}.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4392
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  
When an uninitialized local variable is referenced, it is interpreted as a call to a method that has no arguments
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4393
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  
Assignment to uninitialized local variables also serves as variable declaration.

The variables start to exist until the end of the current scope is reached. The lifetime of local variables is determined when Ruby parses the program
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4394
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  
Assignment to uninitialized local variables also serves as variable declaration.

The variables start to exist until the end of the current scope is reached.

The lifetime of local variables is determined when Ruby parses the program.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4395
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  
Ruby Constants:

Constants begin with an uppercase letter.

Constants defined within a class or module can be accessed from within that class or module, and those defined outside a class or module can be accessed globally
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4396
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  
Constants may not be defined within methods.

Referencing an uninitialized constant produces an error.

Making an assignment to a constant that is already initialized produces a warning.
 
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