Class: Quandora::Users

Inherits:
Request show all
Defined in:
lib/quandora/users.rb

Instance Attribute Summary

Attributes inherited from Request

#api, #params

Instance Method Summary collapse

Methods inherited from Request

#index, #initialize, #show

Constructor Details

This class inherits a constructor from Quandora::Request

Instance Method Details

#create(args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/quandora/users.rb', line 7

def create(args)
  args = args.stringify_keys

  body = {
    "type": "post-user",
    "data": {
      "email": args["email"],
      "password": args["password"],
      "firstName": args["first_name"],
      "lastName": args["last_name"],
      "title": args["title"],
      "isManager": args["is_manager"],
      "aliases": args["aliases"],
      "groups": args["groups"]
    }
  }

  resp = @conn.post(@api) do |req|
    req.body = body.to_s
    req.headers['Content-Type'] = 'application/json'
  end
end

#meObject

API LIST: Me, Index, Show



3
4
5
# File 'lib/quandora/users.rb', line 3

def me
  resp = @conn.get("#{@api}/me")
end