Permalink
Browse files

Better variable name.

  • Loading branch information...
1 parent 0637262 commit afcf3849a86caebe9955d275f1356425e1327957 @gabebw committed Apr 7, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/decoder.rb
View
6 lib/decoder.rb
@@ -1,12 +1,12 @@
# http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener
class Decoder
- def initialize(id)
- @id = id
+ def initialize(hash)
+ @hash = hash
end
def decode
sum = 0
- @id.split('').map do |chunk|
+ @hash.split('').map do |chunk|
Encoder::CHARS.index(chunk)
end.reverse.each_with_index do |chunk, i|
sum += chunk * Encoder::BASE ** i

0 comments on commit afcf384

Please sign in to comment.