Method: String#hasherize

Defined in:
lib/core/string.rb

#hasherize(format = []) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/core/string.rb', line 2

def hasherize(format=[])
  hash = {}
  i = 0
  self.split(%r{[\n|\t|\s| ]+}).collect {|a| a.strip}.each do |f|
    break unless format[i]
    unless f == "" || f.nil?
      hash[format[i]] = f
      i+=1
    end      
  end
  hash
end