Class: Office365::Client
- Inherits:
-
Object
- Object
- Office365::Client
- Defined in:
- lib/office365/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
Instance Method Summary collapse
- #credentials ⇒ Hash
- #credentials? ⇒ Boolean
-
#initialize(options = {}) {|_self| ... } ⇒ Office365::Client
constructor
Initializes a new Client object.
- #user_token? ⇒ Boolean
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Office365::Client
Initializes a new Client object
11 12 13 14 15 16 |
# File 'lib/office365/client.rb', line 11 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def access_token @access_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def client_secret @client_secret end |
#debug ⇒ Object
Returns the value of attribute debug.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def debug @debug end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def redirect_uri @redirect_uri end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def refresh_token @refresh_token end |
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
5 6 7 |
# File 'lib/office365/client.rb', line 5 def tenant_id @tenant_id end |
Instance Method Details
#credentials ⇒ Hash
24 25 26 27 28 29 30 31 |
# File 'lib/office365/client.rb', line 24 def credentials { client_id: client_id, client_secret: client_secret, access_token: access_token, refresh_token: refresh_token } end |
#credentials? ⇒ Boolean
34 35 36 |
# File 'lib/office365/client.rb', line 34 def credentials? credentials.values.none? { |v| blank_string?(v) } end |
#user_token? ⇒ Boolean
19 20 21 |
# File 'lib/office365/client.rb', line 19 def user_token? !(blank_string?(access_token) || blank_string?(refresh_token)) end |