Created
October 6, 2010 23:33
-
-
Save ess/614305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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