Class: Base::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/base/client.rb

Overview

A client containing all the endpoints.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token:, url: 'https://api.base-api.io') ⇒ Client

Initializes a new client with an access_token and optional url.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/base/client.rb', line 36

def initialize(access_token:, url: 'https://api.base-api.io')
  @users =
    Endpoints::Users.new(
      access_token: access_token,
      url: url
    )

  @files =
    Endpoints::Files.new(
      access_token: access_token,
      url: url
    )

  @images =
    Endpoints::Images.new(
      access_token: access_token,
      url: url
    )

  @sessions =
    Endpoints::Sessions.new(
      access_token: access_token,
      url: url
    )

  @emails =
    Endpoints::Emails.new(
      access_token: access_token,
      url: url
    )

  @passwords =
    Endpoints::Passwords.new(
      access_token: access_token,
      url: url
    )
end

Instance Attribute Details

#emailsObject (readonly)

Endpoint for the emails.



24
25
26
# File 'lib/base/client.rb', line 24

def emails
  @emails
end

#filesObject (readonly)

Endpoint for the files.



33
34
35
# File 'lib/base/client.rb', line 33

def files
  @files
end

#imagesObject (readonly)

Endpoint for the images.



27
28
29
# File 'lib/base/client.rb', line 27

def images
  @images
end

#passwordsObject (readonly)

Endpoint for the forgot password flow.



18
19
20
# File 'lib/base/client.rb', line 18

def passwords
  @passwords
end

#sessionsObject (readonly)

Endpoint for the sessions.



21
22
23
# File 'lib/base/client.rb', line 21

def sessions
  @sessions
end

#usersObject (readonly)

Endpoint for the users.



30
31
32
# File 'lib/base/client.rb', line 30

def users
  @users
end