Class: Gillbus::V2::Structs::AccessToken
- Inherits:
-
Base
- Object
- Base
- Gillbus::V2::Structs::AccessToken
show all
- Defined in:
- lib/gillbus/v2/structs/access_token.rb
Instance Attribute Summary
Attributes inherited from Base
#raw_data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
field, from_raw_data, #initialize
Class Method Details
.from_token_string(token) ⇒ Object
8
9
10
11
|
# File 'lib/gillbus/v2/structs/access_token.rb', line 8
def self.from_token_string(token)
raw_data = { "access_token" => token }
from_raw_data(raw_data)
end
|
Instance Method Details
21
22
23
|
# File 'lib/gillbus/v2/structs/access_token.rb', line 21
def
"#{token_type} #{access_token}"
end
|
#expired? ⇒ Boolean
13
14
15
|
# File 'lib/gillbus/v2/structs/access_token.rb', line 13
def expired?
!expires_on.nil? && expires_on <= DateTime.now.new_offset(0)
end
|
#to_s ⇒ Object
17
18
19
|
# File 'lib/gillbus/v2/structs/access_token.rb', line 17
def to_s
access_token
end
|