Module: TropoRest::Client::Application
- Included in:
- TropoRest::Client
- Defined in:
- lib/tropo_rest/client/application.rb
Constant Summary collapse
- SINGULAR_PATH =
"applications/%d".freeze
- PLURAL_PATH =
"applications".freeze
- RESOURCE =
TropoRest::Resource::Application
Instance Method Summary collapse
-
#application(id_or_href) ⇒ TropoRest::Resource::Application
Returns the application specified by an ID.
-
#applications ⇒ Array
Returns the authenticated user’s applications.
-
#create_application(params = {}) ⇒ Hashie::Mash
Creates a new application.
-
#delete_application(id_or_href) ⇒ Hashie::Mash
Permanently destroys the application specified by an ID.
-
#update_application(id_or_href, params = {}) ⇒ Hashie::Mash
Updates an application.
Instance Method Details
#application(id_or_href) ⇒ TropoRest::Resource::Application
Returns the application specified by an ID
22 23 24 25 |
# File 'lib/tropo_rest/client/application.rb', line 22 def application(id_or_href) path = get_path(SINGULAR_PATH, id_or_href) get(path, RESOURCE) end |
#applications ⇒ Array
Returns the authenticated user’s applications
13 14 15 |
# File 'lib/tropo_rest/client/application.rb', line 13 def applications get(PLURAL_PATH, RESOURCE) end |
#create_application(params = {}) ⇒ Hashie::Mash
Creates a new application
38 39 40 |
# File 'lib/tropo_rest/client/application.rb', line 38 def create_application(params={}) post(PLURAL_PATH, RESOURCE.new(params)) end |
#delete_application(id_or_href) ⇒ Hashie::Mash
Permanently destroys the application specified by an ID
47 48 49 50 |
# File 'lib/tropo_rest/client/application.rb', line 47 def delete_application(id_or_href) path = get_path(SINGULAR_PATH, id_or_href) delete(path) end |
#update_application(id_or_href, params = {}) ⇒ Hashie::Mash
Updates an application
65 66 67 68 |
# File 'lib/tropo_rest/client/application.rb', line 65 def update_application(id_or_href, params={}) path = get_path(SINGULAR_PATH, id_or_href) put(path, RESOURCE.new(params)) end |