class LearnLab::Token
Encodable token. Consists of an email, GitHub URL, and timestamp encoded as a Base64 URL safe string.
Attributes
email[R]
timestamp[R]
url[R]
Public Class Methods
new(email, url, timestamp=Time.now.utc)
click to toggle source
# File lib/learn_lab/token.rb, line 10 def initialize(email, url, timestamp=Time.now.utc) @email = email @url = url @timestamp = timestamp end
Public Instance Methods
encoded()
click to toggle source
# File lib/learn_lab/token.rb, line 16 def encoded Base64.urlsafe_encode64(payload.to_json) end
Private Instance Methods
payload()
click to toggle source
# File lib/learn_lab/token.rb, line 22 def payload { lms_email: email, vcs_url: url, timestamp: timestamp } end