Class: Syncano::Resources::Admin

Inherits:
Base
  • Object
show all
Defined in:
lib/syncano/resources/admin.rb

Overview

Admin resource

Instance Attribute Summary

Attributes inherited from Base

#attributes, #destroyed, #id

Class Method Summary collapse

Methods inherited from Base

#[], #[]=, all, #batch, batch_create, #batch_destroy, #batch_save, #batch_update, count, #destroy, #destroyed?, find, #initialize, #new_record?, #reload!, #save, #saved?, #update

Constructor Details

This class inherits a constructor from Syncano::Resources::Base

Class Method Details

.create(client, attributes) ⇒ Syncano::Resources::Base

Wrapper for api “new” method Creates object in Syncano

Parameters:

Returns:



20
21
22
23
# File 'lib/syncano/resources/admin.rb', line 20

def self.create(client, attributes)
  perform_create(client, nil, attributes)
  all(client, map_to_scope_parameters(attributes)).last
end

.find_by_email(client, email, scope_parameters = {}, conditions = {}) ⇒ Syncano::Resources::Admin

Wrapper for api “get_one” method with admin_email as a key

Parameters:

  • client (Syncano::Clients::Base)
  • email (String)
  • scope_parameters (Hash) (defaults to: {})
  • conditions (Hash) (defaults to: {})

Returns:



11
12
13
# File 'lib/syncano/resources/admin.rb', line 11

def self.find_by_email(client, email, scope_parameters = {}, conditions = {})
  perform_find(client, :admin_email, email, scope_parameters, conditions)
end