Module: TM::StringExtensions

Defined in:
lib/tm/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



3
4
5
6
7
8
9
10
# File 'lib/tm/string_extensions.rb', line 3

def to_hash
  return '' if self.nil?
  self.split(/,/).inject({}) do |hash, kv|
    arg, val = kv.split(/:/)
    hash[arg.to_sym] = val
    hash 
  end
end