Class: Syncano::Resources::Folder
- Defined in:
- lib/syncano/resources/folder.rb
Overview
Folder resource
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.find_by_name(client, name, scope_parameters = {}, conditions = {}) ⇒ Syncano::Resources::Folder
Wrapper for api “get_one” method with folder_name as a key.
Instance Method Summary collapse
-
#authorize(api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method.
-
#batch_authorize(batch_client, api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method.
-
#batch_deauthorize(batch_client, api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method.
-
#data_objects ⇒ Syncano::QueryBuilder
Association has_many :data_objects.
-
#deauthorize(api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method.
Methods inherited from Base
#[], #[]=, all, #batch, batch_create, #batch_destroy, #batch_save, #batch_update, count, create, #destroy, #destroyed?, find, #initialize, #new_record?, #reload!, #save, #saved?, #update
Constructor Details
This class inherits a constructor from Syncano::Resources::Base
Class Method Details
.find_by_name(client, name, scope_parameters = {}, conditions = {}) ⇒ Syncano::Resources::Folder
Wrapper for api “get_one” method with folder_name as a key
17 18 19 |
# File 'lib/syncano/resources/folder.rb', line 17 def self.find_by_name(client, name, scope_parameters = {}, conditions = {}) find(client, name, scope_parameters, conditions) end |
Instance Method Details
#authorize(api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method
25 26 27 28 |
# File 'lib/syncano/resources/folder.rb', line 25 def (api_client_id, ) (nil, api_client_id: api_client_id, permission: ) self end |
#batch_authorize(batch_client, api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method
35 36 37 38 |
# File 'lib/syncano/resources/folder.rb', line 35 def (batch_client, api_client_id, ) (batch_client, api_client_id: api_client_id, permission: ) self end |
#batch_deauthorize(batch_client, api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method
54 55 56 57 |
# File 'lib/syncano/resources/folder.rb', line 54 def (batch_client, api_client_id, ) (batch_client, api_client_id: api_client_id, permission: ) self end |
#data_objects ⇒ Syncano::QueryBuilder
Association has_many :data_objects
7 8 9 |
# File 'lib/syncano/resources/folder.rb', line 7 def data_objects ::Syncano::QueryBuilder.new(client, ::Syncano::Resources::DataObject, scope_parameters.merge(folders: @saved_attributes[:name])) end |
#deauthorize(api_client_id, permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method
44 45 46 47 |
# File 'lib/syncano/resources/folder.rb', line 44 def (api_client_id, ) (nil, api_client_id: api_client_id, permission: ) self end |