def some_method(format, language) raise Error unless %w(wiki xml).include?(format.to_s) raise Error unless %w(de en).include?(language.to_s) ...
Ruby Check for bounds
class UsersController < ApplicationController before_filter :authorize before_filter :find_user, :only => [:edit, :update, :destroy] ...
Ruby Code Duplication
by xystus777.myopenid.com,
November 26, 2010 10:15,
2 refactorings, tagged with rails, ruby, refactor, params, format, duplication
Any idea how I can refactor...
arr = []
b={:a => "option1", :b => "option2"}
b.each_pair{ |key,value| arr << "#{key}=#{value}" }
...
Ruby HTML query string
by jalapinto.myopenid.com,
April 29, 2010 00:04,
5 refactorings, tagged with ruby, html, query, params
Trying to create the query ...
I need to check the given i...