Class: Square::BearerAuthCredentials
- Inherits:
-
Object
- Object
- Square::BearerAuthCredentials
- Defined in:
- lib/square/http/auth/o_auth2.rb
Overview
Data class for BearerAuthCredentials.
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
- #clone_with(access_token: nil) ⇒ Object
-
#initialize(access_token:) ⇒ BearerAuthCredentials
constructor
A new instance of BearerAuthCredentials.
Constructor Details
#initialize(access_token:) ⇒ BearerAuthCredentials
Returns a new instance of BearerAuthCredentials.
26 27 28 29 30 |
# File 'lib/square/http/auth/o_auth2.rb', line 26 def initialize(access_token:) raise ArgumentError, 'access_token cannot be nil' if access_token.nil? @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
24 25 26 |
# File 'lib/square/http/auth/o_auth2.rb', line 24 def access_token @access_token end |
Instance Method Details
#clone_with(access_token: nil) ⇒ Object
32 33 34 35 36 |
# File 'lib/square/http/auth/o_auth2.rb', line 32 def clone_with(access_token: nil) access_token ||= self.access_token BearerAuthCredentials.new(access_token: access_token) end |