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

by Fu86, July 19, 2011 02:35, 2 refactorings, tagged with ruby, method, params, bounding

I need to check the given i...

Ee0505bbd355292778077fb662c88f13 Talk
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...

55502f40dc8b7c769880b10874abc9d0 Talk
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 ...

55502f40dc8b7c769880b10874abc9d0 Talk