Skip to content

Instantly share code, notes, and snippets.

@ess
Created October 6, 2010 23:33
Show Gist options
  • Save ess/614305 to your computer and use it in GitHub Desktop.
Save ess/614305 to your computer and use it in GitHub Desktop.
def self.uri(options = {})
uri = [ Canvas::BASE_URI ]
uri.push self.model
uri.push options[:id].to_s if options[:id]
uri.push options[:action].to_s if options [:action]
apikey = options[:api_key] || @@api_key
uri.push "?api_key=#{apikey}" if apikey
uri.join '/'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment