Skip to content

Commit

Permalink
Do not define methods if they're already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszx0 committed Apr 11, 2013
1 parent cdda520 commit 71c1acb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/resque/core_ext/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ def symbolize_keys
options[(key.to_sym rescue key) || key] = value
options
end
end
end unless Hash.respond_to?(:symbolize_keys)

def symbolize_keys!
self.replace(self.symbolize_keys)
end
end unless Hash.respond_to?(:symbolize_keys!)

def slice(*keys)
hash = self.class.new
keys.each { |k| hash[k] = self[k] if has_key?(k) }
hash
end
end
end unless Hash.respond_to?(:slice)
end

0 comments on commit 71c1acb

Please sign in to comment.