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.
-
#images ⇒ Object
readonly
Endpoint for the images.
-
#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.
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
#emails ⇒ Object (readonly)
Endpoint for the emails.
24 25 26 |
# File 'lib/base/client.rb', line 24 def emails @emails end |
#files ⇒ Object (readonly)
Endpoint for the files.
33 34 35 |
# File 'lib/base/client.rb', line 33 def files @files end |
#images ⇒ Object (readonly)
Endpoint for the images.
27 28 29 |
# File 'lib/base/client.rb', line 27 def images @images end |
#passwords ⇒ Object (readonly)
Endpoint for the forgot password flow.
18 19 20 |
# File 'lib/base/client.rb', line 18 def passwords @passwords end |
#sessions ⇒ Object (readonly)
Endpoint for the sessions.
21 22 23 |
# File 'lib/base/client.rb', line 21 def sessions @sessions end |
#users ⇒ Object (readonly)
Endpoint for the users.
30 31 32 |
# File 'lib/base/client.rb', line 30 def users @users end |