Class: Syncano::Resources::User

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

Overview

User 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, 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

.count(client, scope_parameters = {}, conditions = {}) ⇒ Integer

Wrapper for api “count” method

Parameters:

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

Returns:

  • (Integer)


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

def self.count(client, scope_parameters = {}, conditions = {})
  response = perform_count(client, scope_parameters, conditions)
  response.data if response.status
end

.login(client, username, password) ⇒ Integer

Wrapper for api “login” method

Parameters:

Returns:

  • (Integer)


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

def self.(client, username, password)
  response = (client, user_name: username, password: password)
  response.data
end