Changes

Ruby Operators

50 bytes removed, 12:38, 1 December 2007
The Anatomy of a Ruby Operation
== The Anatomy of a Ruby Operation ==
In Ruby, as with most other programming languages, operations consist of values on which the calculation is to be performed (called ''operands'') and an ''operator'' which dictates the mathematical operation to be performed. Typically, the ''operands'' are placed either side of the ''operator''. Optionally, the ''assignment'' operator (=) can be used to assign the result of the operation to, for example, a variable. Let's take the most basic of operations, executed in ''irb'':
<pre>
irb(main):036:0> 1 + 1
=> 2
irb(main):037:0> result = 1 + 1
=> 2
</pre>