Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.leer_jugadores
- log = File.open( "#{RAILS_ROOT}/public/jugadores.yaml" )
- jugadores = []
- indice_jugador = 0
- rack = []
- indice_rack = 0
- i=0
- yp = YAML::load_documents( log ) { |doc|
- doc.each{|mano| mano.select {
- |key, value|
- if key == 'rack'
- rack[indice_rack] = value
- indice_rack +=1
- i+=1
- end
- if key =='jugador'
- jugadores[indice_jugador] = value
- indice_jugador +=1
- end
- }
- }
- }
- puts yp;
- return jugadores,rack
- end
Add Comment
Please, Sign In to add comment