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.



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
73
74
75
76
77
78
79
80
81
82
# File 'lib/base/client.rb', line 40

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
    )

  @mailing_lists =
    Endpoints::MailingLists.new(
      access_token: access_token,
      url: url
    )
end

Instance Attribute Details

#emailsObject (readonly)

Endpoint for the emails.



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

def emails
  @emails
end

#filesObject (readonly)

Endpoint for the files.



37
38
39
# File 'lib/base/client.rb', line 37

def files
  @files
end

#imagesObject (readonly)

Endpoint for the images.



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

def images
  @images
end

#mailing_listsObject (readonly)

Endpoint for the mailing lists



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

def mailing_lists
  @mailing_lists
end

#passwordsObject (readonly)

Endpoint for the forgot password flow.



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

def passwords
  @passwords
end

#sessionsObject (readonly)

Endpoint for the sessions.



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

def sessions
  @sessions
end

#usersObject (readonly)

Endpoint for the users.



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

def users
  @users
end