module DeepTest::Option::Hash
Public Class Methods
from_string(string)
click to toggle source
# File lib/deep_test/option.rb, line 28 def self.from_string(string) hash = {} string.split(/,/).each do |pair| key, unevaled_value = pair.split(/:/) value = eval(unevaled_value) value = value.gsub(/%20/, " ") if ::String === value hash[key.to_sym] = value end hash end
to_string(hash)
click to toggle source
# File lib/deep_test/option.rb, line 19 def self.to_string(hash) pairs = [] hash.each do |key, value| value = value.gsub(/ /,'%20') if (::String === value) pairs << "#{key}:#{value.inspect}" end pairs.join(",") end