Class: Rallio::SignOnToken

Inherits:
Base
  • Object
show all
Defined in:
lib/rallio/sign_on_token.rb

Overview

Represents a sign on token object as it comes from Rallio.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

app_credentials

Instance Attribute Details

#expires_atDateTime


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rallio/sign_on_token.rb', line 10

class SignOnToken < Base
  attribute :token, String
  attribute :expires_at, DateTime
  attribute :url, String

  # Creates new sign on token for user_id.
  #
  # @param user_id [Integer]
  # @return [Rallio::SignOnToken]
  def self.create(user_id:)
    response = self.post("/users/#{user_id}/sign_on_tokens", headers: app_credentials)
    new response.parsed_response['sign_on_token']
  end
end

#tokenString


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rallio/sign_on_token.rb', line 10

class SignOnToken < Base
  attribute :token, String
  attribute :expires_at, DateTime
  attribute :url, String

  # Creates new sign on token for user_id.
  #
  # @param user_id [Integer]
  # @return [Rallio::SignOnToken]
  def self.create(user_id:)
    response = self.post("/users/#{user_id}/sign_on_tokens", headers: app_credentials)
    new response.parsed_response['sign_on_token']
  end
end

#urlString


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rallio/sign_on_token.rb', line 10

class SignOnToken < Base
  attribute :token, String
  attribute :expires_at, DateTime
  attribute :url, String

  # Creates new sign on token for user_id.
  #
  # @param user_id [Integer]
  # @return [Rallio::SignOnToken]
  def self.create(user_id:)
    response = self.post("/users/#{user_id}/sign_on_tokens", headers: app_credentials)
    new response.parsed_response['sign_on_token']
  end
end

Class Method Details

.create(user_id:) ⇒ Rallio::SignOnToken

Creates new sign on token for user_id.


19
20
21
22
# File 'lib/rallio/sign_on_token.rb', line 19

def self.create(user_id:)
  response = self.post("/users/#{user_id}/sign_on_tokens", headers: app_credentials)
  new response.parsed_response['sign_on_token']
end