Class: Base::Client
- Inherits:
-
Object
- Object
- Base::Client
- Defined in:
- lib/base/client.rb
Overview
A client containing all the endpoints.
Instance Attribute Summary collapse
-
#emails ⇒ Object
readonly
Endpoint for the emails.
-
#files ⇒ Object
readonly
Endpoint for the files.
-
#forms ⇒ Object
readonly
Endpoint for the files.
-
#images ⇒ Object
readonly
Endpoint for the images.
-
#mailing_lists ⇒ Object
readonly
Endpoint for the mailing lists.
-
#passwords ⇒ Object
readonly
Endpoint for the forgot password flow.
-
#sessions ⇒ Object
readonly
Endpoint for the sessions.
-
#users ⇒ Object
readonly
Endpoint for the users.
Instance Method Summary collapse
-
#initialize(access_token:, url: 'https://api.base-api.io') ⇒ Client
constructor
Initializes a new client with an access_token and optional url.
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
#emails ⇒ Object (readonly)
Endpoint for the emails.
29 30 31 |
# File 'lib/base/client.rb', line 29 def emails @emails end |
#files ⇒ Object (readonly)
Endpoint for the files.
38 39 40 |
# File 'lib/base/client.rb', line 38 def files @files end |
#forms ⇒ Object (readonly)
Endpoint for the files.
41 42 43 |
# File 'lib/base/client.rb', line 41 def forms @forms end |
#images ⇒ Object (readonly)
Endpoint for the images.
32 33 34 |
# File 'lib/base/client.rb', line 32 def images @images end |
#mailing_lists ⇒ Object (readonly)
Endpoint for the mailing lists
20 21 22 |
# File 'lib/base/client.rb', line 20 def mailing_lists @mailing_lists end |
#passwords ⇒ Object (readonly)
Endpoint for the forgot password flow.
23 24 25 |
# File 'lib/base/client.rb', line 23 def passwords @passwords end |
#sessions ⇒ Object (readonly)
Endpoint for the sessions.
26 27 28 |
# File 'lib/base/client.rb', line 26 def sessions @sessions end |
#users ⇒ Object (readonly)
Endpoint for the users.
35 36 37 |
# File 'lib/base/client.rb', line 35 def users @users end |