Class: Webull::Tokens
- Inherits:
-
Object
- Object
- Webull::Tokens
- Defined in:
- lib/webull/authenticator.rb
Overview
Tokens object describes a full set of API tokens
Instance Attribute Summary collapse
-
#access ⇒ Object
readonly
Returns the value of attribute access.
-
#refresh ⇒ Object
readonly
Returns the value of attribute refresh.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Tokens
constructor
A new instance of Tokens.
Constructor Details
#initialize(params = {}) ⇒ Tokens
Returns a new instance of Tokens.
11 12 13 14 |
# File 'lib/webull/authenticator.rb', line 11 def initialize(params = {}) @access = params[:access] @refresh = params[:refresh] end |
Instance Attribute Details
#access ⇒ Object (readonly)
Returns the value of attribute access.
9 10 11 |
# File 'lib/webull/authenticator.rb', line 9 def access @access end |
#refresh ⇒ Object (readonly)
Returns the value of attribute refresh.
9 10 11 |
# File 'lib/webull/authenticator.rb', line 9 def refresh @refresh end |
Class Method Details
.from_resp(resp) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/webull/authenticator.rb', line 16 def self.from_resp(resp) Tokens.new( access: resp['accessToken'], refresh: resp['refreshToken'] ) end |