Class: Ribose::Client
- Inherits:
-
Object
- Object
- Ribose::Client
- Defined in:
- lib/ribose/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_email ⇒ Object
Returns the value of attribute api_email.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#uid ⇒ Object
Returns the value of attribute uid.
Class Method Summary collapse
-
.from_login(email:, password:) ⇒ Ribose::Client
Initiate a ribose client.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 |
# File 'lib/ribose/client.rb', line 5 def initialize( = {}) initialize_client_details() end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/ribose/client.rb', line 3 def access_token @access_token end |
#api_email ⇒ Object
Returns the value of attribute api_email.
3 4 5 |
# File 'lib/ribose/client.rb', line 3 def api_email @api_email end |
#api_token ⇒ Object
Returns the value of attribute api_token.
3 4 5 |
# File 'lib/ribose/client.rb', line 3 def api_token @api_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
3 4 5 |
# File 'lib/ribose/client.rb', line 3 def client_id @client_id end |
#uid ⇒ Object
Returns the value of attribute uid.
3 4 5 |
# File 'lib/ribose/client.rb', line 3 def uid @uid end |
Class Method Details
.from_login(email:, password:) ⇒ Ribose::Client
Initiate a ribose client
This interface takes email, password, api_email and api_token Then it will do all the underlying work to find out client id and uid Finally it will return a ribose client.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ribose/client.rb', line 21 def self.from_login(email:, password:) session = Ribose::Session.create( username: email, password: password, ) new( api_email: email, uid: session.uid, client_id: session.client, api_token: session["access-token"], access_token: session["access-token"], ) end |