BACKTRACE

(condense)

Back to Posts List

GET

Add custom operators in Ruby

Jay Phillips developed the ‘superators’ gem, which enables the use of custom operators in Ruby. for example.

  1. require ‘rubygems’  
  2. require ‘superators’  
  3.   
  4. class Array  
  5.   superator “<—-” do |operand|  
  6.     self << operand.reverse  
  7.   end  
  8. end  
  9.   
  10. [“jay”] <—- “spillihp”  

POST

blog comments powered by Disqus

I Don't have cookies.

ELAD ENV

Variable Value
LINKEDIN
TWITTER
FACEBOOK
GITHUB
WWR
IRC
{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]}
SKYPE
eladmeidar

You're seeing this error because I think it is funny.