Class: ReplIdentity::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/repl_identity/token.rb

Instance Method Summary collapse

Constructor Details

#initialize(audience) ⇒ Token

Returns a new instance of Token.



3
4
5
6
7
8
9
10
11
12
# File 'lib/repl_identity/token.rb', line 3

def initialize(audience)
    token, status = Open3.capture2(
        REPLIT_CLI_PATH, "identity", "create",
        "-audience=#{audience}"
    )

    raise "Something went wrong" unless status.success?

    @token = token.strip
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/repl_identity/token.rb', line 14

def to_s
    @token
end