Ruby’s Unary Operators and How to Redefine Their Functionality

In math, a unary operation is an operation with a single input. In Ruby, a unary operator is an operator which only takes a single 'argument' in the form of a receiver. For example, the - on -5 or ! on!true. In contrast, a binary operator, such as in 2 + 3, deals with twoarguments. Here, 2 and 3 (which become one receiver and one argument in a method call to +).


Ruby’s Unary Operators and How to Redefine Their Functionality #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper

U
Nezir Zahirovic

Freelance software developer Ruby On Rails (4 years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles