Thread: Ruby on Rails
View Single Post
  #7 (permalink)  
Old 10-09-2007, 03:07 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,321
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Default Ruby on Rails

Storing Data in Variables - Working with Variables

To get started with variables in Ruby, follow these steps:
  1. Enter this Ruby code in a new file, variables.rb:

    Code:
    temperature = 36
    puts “The temperature is “ + String(temperature) + “.”
    temperature = temperature + 5
    puts “Now the temperature is “ + String(temperature) + “.”
  2. Save the variables.rb file.
  3. Run variables.rb to see the result:
Quote:
C:\rubydev>ruby variables.rb
The temperature is 36.
Now the temperature is 41.
__________________
Prasanna Vignesh
MCPD | Web Developer
Reply With Quote