Sha256: 57cc304f74d88e84a49c3b19a7b89e5acaad545d44bd1613d8b3e0415c82df83
Contents?: true
Size: 460 Bytes
Versions: 1
Compression:
Stored size: 460 Bytes
Contents
require 'coercible' class ENVied::Coercer::ENViedString < Coercible::Coercer::String def to_array(str) str.split(/(?<!\\),/).map{|i| i.gsub(/\\,/,',') } end def to_hash(str) require 'cgi' ::CGI.parse(str).map { |key, values| [key, values[0]] }.to_h end def to_uri(str) require 'uri' ::URI.parse(str) end def to_integer(str) Integer(str) rescue ArgumentError raise_unsupported_coercion(str, __method__) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
envied-0.9.1 | lib/envied/coercer/envied_string.rb |