Exception: UUID::NCName::AmbiguousToken

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/uuid/ncname.rb

Overview

This error gets thrown when a UUID-NCName token can't be positively determined to be one version or the other.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, v0: nil, v1: nil) ⇒ AmbiguousToken

Returns a new instance of AmbiguousToken.

Parameters:

  • token (#to_s)

    The token in question

  • v0 (#to_s) (defaults to: nil)

    UUID decoded with decoding scheme version 0

  • v1 (#to_s) (defaults to: nil)

    UUID decoded with decoding scheme version 1



196
197
198
199
# File 'lib/uuid/ncname.rb', line 196

def initialize token, v0: nil, v1: nil
  @v0 = v0 || from_ncname(token, version: 0)
  @v1 = v1 || from_ncname(token, version: 1)
end

Instance Attribute Details

#tokenString (readonly)

Returns The ambiguous token.

Returns:

  • (String)

    The ambiguous token



186
187
188
# File 'lib/uuid/ncname.rb', line 186

def token
  @token
end

#v0String (readonly)

Returns The UUID when decoded using version 0.

Returns:

  • (String)

    The UUID when decoded using version 0



188
189
190
# File 'lib/uuid/ncname.rb', line 188

def v0
  @v0
end

#v1String (readonly)

Returns The UUID when decoded using version 1.

Returns:

  • (String)

    The UUID when decoded using version 1



190
191
192
# File 'lib/uuid/ncname.rb', line 190

def v1
  @v1
end