Class: SimplyAuth::Session

Inherits:
Model
  • Object
show all
Defined in:
app/models/simply_auth/session.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#attributes=, collection_path, #collection_path, create, #data, #data=, find, #initialize, instance_path, #instance_path, owner_class, path_component, #persisted=, #persisted?, #save

Constructor Details

This class inherits a constructor from SimplyAuth::Model

Instance Attribute Details

#emailObject

Returns the value of attribute email.



3
4
5
# File 'app/models/simply_auth/session.rb', line 3

def email
  @email
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'app/models/simply_auth/session.rb', line 3

def password
  @password
end

#userObject

Returns the value of attribute user.



3
4
5
# File 'app/models/simply_auth/session.rb', line 3

def user
  @user
end

#user_pool_idObject

Returns the value of attribute user_pool_id.



3
4
5
# File 'app/models/simply_auth/session.rb', line 3

def user_pool_id
  @user_pool_id
end

Class Method Details

.owner_class_nameObject



12
13
14
# File 'app/models/simply_auth/session.rb', line 12

def self.owner_class_name
  "UserPool"
end

Instance Method Details

#attributesObject



6
7
8
# File 'app/models/simply_auth/session.rb', line 6

def attributes
  super.merge(email: email, password: password, id: id)
end

#destroyObject



18
19
20
21
22
23
# File 'app/models/simply_auth/session.rb', line 18

def destroy
  response = RestClient.delete(
    "https://api.simplyauth.com#{instance_path}",
    accept: :json
  )
end

#owner_idObject



15
16
17
# File 'app/models/simply_auth/session.rb', line 15

def owner_id
  user_pool_id
end