def hash_from_string string, value
string.split('.').reverse.inject(value) { |rv, e| rv = { e => rv } }
end
class String
def squish
x = 0
...
Ruby Function to remove consiste...
by mxcl,
February 27, 2010 15:01,
3 refactorings
The code doesn't feel elega...
attributes.collect{ |(key, value)| "#{$1}.#{value}" if key =~ /^svc_(\w\w)_id$/ }.compact
Ruby On Ruby Hash Extraction Using ...
by mxcl,
February 25, 2010 13:42
This is probably the most s...
Ruby On Create a baseXX string base...
by mxcl,
February 22, 2010 11:17
I experimented with this to...
A slightly more readable ve...