29 Feb '12, 6pm

Ruby Unary Operators

It seems dangerous to override the "!" operator, because when used in conditions (if, until, ...) the condition may not evaluate as expected... For example (in Ruby 1.9): >> str = "hey" "hey" >> puts "if condition valued to true" if (str) #(str) condition evaluated to "true" if condition valued to true nil >> puts "if condition valued to true" if (!str) #(str) condition evaluated to "false" nil ### untill here, everything was normall ### now we overload the ! operator of "str" , and see how it impacts the if conditions-evaluation: >> def str.!; swapcase; end nil >> puts "if condition valued to true" if (str) #(str) condition evaluated to "true", as before if condition valued to true nil >> puts "if condition valued to true" if (!str) #(str) condition evaluated to **"true"** ----> because of the ! overloading if condition valued to true nil It seems a very practical option ...

Full article: http://www.rubyinside.com/rubys-unary-operators-and-how-t...

Tweets

@MikeG1 can you promote rails-api on Thanks!

afreshcup.com 12 Mar '12, 4pm

is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the univer...

More Than Half of Restaurant Operators Plan Equ...

appliancemagazine.com 01 Mar '12, 11pm

The outlook for the restaurant industry is positive for the coming months, with the National Restaurant Association’s Rest...

#Ruby Ruby in Twenty Minutes

ruby-lang.org 03 Mar '12, 9am

This is a small Ruby tutorial that should take no more than 20 minutes to complete. It makes the assumption that you alrea...

Did you know Ruby 1.9 supports the goto statement?

rubyflow.com 29 Feb '12, 12pm

Did you know Ruby 1.9 supports the goto statement? Posted by patshaughnessy on February 29, 2012 — 0 comments It turns out...

Metaprogramming in Ruby: It’s All About the Self

yehudakatz.com 07 Mar '12, 8am

@wycats Right. That is why they are unnecessary and only confuse developers. I didn’t see this until I happened to discove...

Telecom operators successfully complete next ge...

eetimes.com 27 Feb '12, 2am

The Wireless Broadband Alliance (WBA), the industry association focused on driving the next generation Wi-Fi experience, h...

UK issues its first free EU ETS allowances to a...

decc.gov.uk 01 Mar '12, 11am

The UK was the first country out of all the Member States to start issuing its aviation allowances. The first free allowan...

I love Ruby because

rubyflow.com 12 Mar '12, 8pm

I love Ruby because ... Posted by rtdp on March 12, 2012 — 0 comments I really love ruby language, and so do many folks us...

How to create a Ruby extension in C in 43 second

rubyinside.com 01 Mar '12, 9pm

Zenspider, the master of all things Ruby crossed with C, picked up the gauntlet and, using RubyInline (previously covered ...

Ruby 1.9.3p0 released! [Programming Language] #...

ruby-lang.org 02 Mar '12, 2am

Security Fix for Ruby OpenSSL module: Allow "0/n splitting" as a prevention for the TLS BEAST attack. Denial of service at...

Padrino

Padrino

padrinorb.com 02 Mar '12, 3am

Many people love the simplicity and expressiveness of Sinatra but quickly find themselves missing a great deal of function...

@simonszu ich wollte Ruby 1.9 probieren und das...

ruby-lang.org 08 Mar '12, 9pm

Kompilierung aus dem Quellcode ist der Standard, nach dem Software seit vielen, vielen Jahren verteilt wird. Die meisten S...

Ruby Brasil:

ruby-br.org 09 Mar '12, 7pm

A Brain está contratando desenvolvedores com experiência em Ruby on Rails para dois projetos diferentes no RJ. Os interess...

writing readable ruby

rubyflow.com 03 Mar '12, 5pm

writing readable ruby Posted by alindeman on March 03, 2012 — 0 comments Over on the Highgroove blog , Brian posts some th...