Class: Vimeo::Advanced::Base
- Inherits:
-
Object
- Object
- Vimeo::Advanced::Base
- Includes:
- HTTParty
- Defined in:
- lib/vimeo/advanced/base.rb
Instance Method Summary collapse
-
#initialize(api_key, secret, format_options = {}) ⇒ Base
constructor
TODO: Pass an auth token, if you’ve already got one TODO: implement format_options Requires your API key and secret phrase.
-
#login_link(perms) ⇒ Object
Generates a link that allows a user to authorize your web application to use the advanced API.
-
#upload_sig(ticket_id, auth_token) ⇒ Object
Generates the proper API signature for a file upload.
Constructor Details
#initialize(api_key, secret, format_options = {}) ⇒ Base
TODO: Pass an auth token, if you’ve already got one TODO: implement format_options Requires your API key and secret phrase. The API key and secret are prepended to every request.
12 13 14 15 |
# File 'lib/vimeo/advanced/base.rb', line 12 def initialize(api_key, secret, ={}) @auth = { :api_key => api_key } @secret = secret end |
Instance Method Details
#login_link(perms) ⇒ Object
Generates a link that allows a user to authorize your web application to use the advanced API
19 20 21 22 |
# File 'lib/vimeo/advanced/base.rb', line 19 def login_link(perms) api_sig = generate_api_sig :perms => perms "http://vimeo.com/services/auth/?api_key=#{@auth[:api_key]}&perms=#{perms}&api_sig=#{api_sig}" end |
#upload_sig(ticket_id, auth_token) ⇒ Object
Generates the proper API signature for a file upload.
27 28 29 30 31 32 33 34 |
# File 'lib/vimeo/advanced/base.rb', line 27 def upload_sig(ticket_id, auth_token) = { :ticket_id => ticket_id, :auth_token => auth_token } generate_api_sig end |