Module: ENVied::Coercer::CoercerExts

Defined in:
lib/envied/coercer.rb

Instance Method Summary collapse

Instance Method Details

#to_array(str) ⇒ Object



6
7
8
# File 'lib/envied/coercer.rb', line 6

def to_array(str)
  str.split(/(?<!\\),/).map{|i| i.gsub(/\\,/,',') }
end

#to_hash(str) ⇒ Object



10
11
12
13
# File 'lib/envied/coercer.rb', line 10

def to_hash(str)
  require 'rack/utils'
  ::Rack::Utils.parse_query(str)
end