
class Numeric
  @@currencies = {'dollar' => 1, 'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019}
  def method_missing(method_id)
    singular_currency = method_id.to_s.gsub( /s$/, '')
    if @@currencies.has_key?(from_currency)
      self / @@currencies[from_currency]
    else
      super
    end
  end
  def in(symbol) 
    @@currencies = {'dollar' => 1, 'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019}
    singular_currency = symbol.to_s.gsub( /s$/, '')
    if @@currencies.has_key?(from_currency)
      self * @@currencies[from_currency]
    end
  end      
end

print 3.dollar.in(:dollar)