Skip to content

Instantly share code, notes, and snippets.

@jsvensson
Created September 28, 2012 23:02
Show Gist options
  • Save jsvensson/3802518 to your computer and use it in GitHub Desktop.
Save jsvensson/3802518 to your computer and use it in GitHub Desktop.
module SplitDeclarations
def self.split(dec)
dec = dec.split(/; ?/)
list = {}
dec.each do |d|
pair = d.split(/: ?/)
list[pair[0]] = pair[1]
end
list
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment