Class: Dato::Account::Repo::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/dato/account/repo/account.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dato::Account::Repo::Base

Instance Method Details

#create(resource_attributes) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/dato/account/repo/account.rb', line 8

def create(resource_attributes)
  body = JsonApiSerializer.new(
    type: :account,
    attributes: %i(email password),
    required_attributes: %i(email password)
  ).serialize(resource_attributes)

  post_request '/account', body
end

#findObject



27
28
29
# File 'lib/dato/account/repo/account.rb', line 27

def find
  get_request '/account'
end

#reset_password(resource_attributes) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/dato/account/repo/account.rb', line 31

def reset_password(resource_attributes)
  body = JsonApiSerializer.new(
    type: :account,
    attributes: %i(email),
    required_attributes: %i(email)
  ).serialize(resource_attributes)

  post_request '/account/reset_password', body
end

#update(resource_attributes) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/dato/account/repo/account.rb', line 18

def update(resource_attributes)
  body = JsonApiSerializer.new(
    type: :account,
    attributes: %i(email password)
  ).serialize(resource_attributes)

  put_request '/account', body
end