Skip to content

Instantly share code, notes, and snippets.

@mchung
Created June 16, 2012 04:02
Show Gist options
  • Save mchung/2939858 to your computer and use it in GitHub Desktop.
Save mchung/2939858 to your computer and use it in GitHub Desktop.
Slicehost API
require 'rubygems'
require 'activeresource'
SITE = "https://<key goes here>@api.slicehost.com/"
class Slice < ActiveResource::Base
self.site = SITE
def self.find_by_name(name)
Slice.find(:first, :params => { :name => name })
end
end
# Address class is required for Slice class
class Address < String; end
class Zone < ActiveResource::Base
self.site = SITE
end
class Record < ActiveResource::Base
self.site = SITE
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment