lib/codeguessing/game.rb in codeguessing-0.4.6 vs lib/codeguessing/game.rb in codeguessing-0.4.7

- old
+ new

@@ -73,29 +73,29 @@ when 'win' then true when 'loose' then false end end + def cur_game + hash = {} + self.instance_variables.each do |k, v| + new_k = k.to_s.gsub('@','').to_sym + hash[new_k] = self.instance_variable_get(k) + end + hash + end + private def check?(varible) return false if varible == 0 true end def random code = '' MAX_SIZE.times { code += rand(1..6).to_s } - code - end - - def cur_game - hash = {} - self.instance_variables.each do |k, v| - new_k = k.to_s.gsub('@','').to_sym - hash[new_k] = self.instance_variable_get(k) - end - hash + code end end end