update lib to create a hash for resources, and build in ruby