Class: Aveceine
- Inherits:
-
Object
- Object
- Aveceine
- Defined in:
- lib/aveceine.rb
Class Method Summary collapse
Class Method Details
.load_hash(io) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/aveceine.rb', line 15 def self.load_hash(io) h = Hash.new(); io.each { |line| key,value = line.chomp().split(/\t/,2); h[key]=value; }; io.close(); return h; end |
.save_hash(io, h) ⇒ Object
10 11 12 13 |
# File 'lib/aveceine.rb', line 10 def self.save_hash(io,h) h.each { |key,value| io.puts("#{key}\t#{value}"); } io.close(); end |
.to_hash(a) ⇒ Object
5 6 7 8 |
# File 'lib/aveceine.rb', line 5 def self.to_hash(a) a.uniq!(); return Hash[*((1..a.size).zip(a.sort).flatten)]; end |