Class: Tarantool::Client::UUID
- Inherits:
-
Data
- Object
- Data
- Tarantool::Client::UUID
- Defined in:
- tarantool-client/lib/tarantool/client/uuid.rb,
tarantool-client/lib/tarantool/client/uuid.rb
Overview
A Tarantool uuid value; only instances of this type are sent as MP_EXT uuid, never plain strings.
Constant Summary collapse
- FORMAT =
/\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value:) ⇒ UUID
constructor
A new instance of UUID.
- #to_s ⇒ Object
Constructor Details
#initialize(value:) ⇒ UUID
Returns a new instance of UUID.
7 8 9 10 11 |
# File 'tarantool-client/lib/tarantool/client/uuid.rb', line 7 def initialize(value:) raise ArgumentError, "invalid UUID: #{value.inspect}" unless value.is_a?(String) && value.match?(UUID::FORMAT) super(value: value.downcase.freeze) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/uuid.rb', line 6 def value @value end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'tarantool-client/lib/tarantool/client/uuid.rb', line 13 def to_s value end |