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.



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
83
84
85
86
87
88
89
90
91
92
# File 'lib/base/client.rb', line 44

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
    )

  @forms =
    Endpoints::Forms.new(
      access_token: access_token,
      url: url
    )
end

Instance Attribute Details

#emailsObject (readonly)

Endpoint for the emails.



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

def emails
  @emails
end

#filesObject (readonly)

Endpoint for the files.



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

def files
  @files
end

#formsObject (readonly)

Endpoint for the files.



41
42
43
# File 'lib/base/client.rb', line 41

def forms
  @forms
end

#imagesObject (readonly)

Endpoint for the images.



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

def images
  @images
end

#mailing_listsObject (readonly)

Endpoint for the mailing lists



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

def mailing_lists
  @mailing_lists
end

#passwordsObject (readonly)

Endpoint for the forgot password flow.



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

def passwords
  @passwords
end

#sessionsObject (readonly)

Endpoint for the sessions.



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

def sessions
  @sessions
end

#usersObject (readonly)

Endpoint for the users.



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

def users
  @users
end