Module: RedditKit::Client::Apps
- Included in:
- RedditKit::Client
- Defined in:
- lib/redditkit/client/apps.rb
Overview
Methods for operating on apps in the current user’s account.
Instance Method Summary collapse
-
#add_developer(user, app_identifier) ⇒ Object
Add a user as a developer of an app.
-
#create_app(name, options = {}) ⇒ Object
(also: #update_app)
Create or update an app.
-
#delete_app(app_identifier) ⇒ Object
Delete an app.
-
#remove_developer(user, app_identifier) ⇒ Object
Remove an app’s developer.
-
#revoke_app(app_identifier) ⇒ Object
Revoke an app.
Instance Method Details
#add_developer(user, app_identifier) ⇒ Object
Add a user as a developer of an app.
43 44 45 46 47 48 |
# File 'lib/redditkit/client/apps.rb', line 43 def add_developer(user, app_identifier) username = extract_string user, :username parameters = { :name => username, :client_id => app_identifier } post 'api/adddeveloper', parameters end |
#create_app(name, options = {}) ⇒ Object Also known as: update_app
Create or update an app.
14 15 16 17 18 19 20 21 22 |
# File 'lib/redditkit/client/apps.rb', line 14 def create_app(name, = {}) description = [:description] about_url = [:about_url] redirect_url = [:redirect_url] app_identifier = [:app_identifier] parameters = { :client_id => app_identifier, :name => name, :description => description, :about_url => about_url, :redirect_uri => redirect_url } post('api/updateapp', parameters) end |
#delete_app(app_identifier) ⇒ Object
Delete an app.
28 29 30 |
# File 'lib/redditkit/client/apps.rb', line 28 def delete_app(app_identifier) post 'api/deleteapp', :client_id => app_identifier end |
#remove_developer(user, app_identifier) ⇒ Object
Remove an app’s developer.
54 55 56 57 58 59 |
# File 'lib/redditkit/client/apps.rb', line 54 def remove_developer(user, app_identifier) username = extract_string user, :username parameters = { :name => username, :client_id => app_identifier } post('api/removedeveloper', parameters) end |
#revoke_app(app_identifier) ⇒ Object
Revoke an app.
35 36 37 |
# File 'lib/redditkit/client/apps.rb', line 35 def revoke_app(app_identifier) post 'api/revokeapp', :client_id => app_identifier end |