Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/magicspec/ext/string.rb

Instance Method Summary collapse

Instance Method Details

#lazy_to_hashObject



2
3
4
5
6
7
8
9
10
# File 'lib/magicspec/ext/string.rb', line 2

def lazy_to_hash
  hash = { }
  return hash if self.empty?
  arr = self.split(',').map { |i| i.strip }
  arr.each do |key|
    hash[key.to_sym] = true 
  end #each
  hash
end