Class: ActiveRecord::ConnectionAdapters::Redshift::OID::Uuid

Inherits:
Type::Value
  • Object
show all
Defined in:
lib/active_record/connection_adapters/redshift/oid/uuid.rb

Overview

:nodoc:

Constant Summary collapse

RFC_4122 =
%r{\A\{?[a-fA-F0-9]{4}-?
[a-fA-F0-9]{4}-?
[a-fA-F0-9]{4}-?
[1-5][a-fA-F0-9]{3}-?
[8-Bab][a-fA-F0-9]{3}-?
[a-fA-F0-9]{4}-?
[a-fA-F0-9]{4}-?
[a-fA-F0-9]{4}-?\}?\z}x

Instance Method Summary collapse

Instance Method Details

#typeObject



17
18
19
# File 'lib/active_record/connection_adapters/redshift/oid/uuid.rb', line 17

def type
  :uuid
end

#type_cast(value) ⇒ Object



21
22
23
# File 'lib/active_record/connection_adapters/redshift/oid/uuid.rb', line 21

def type_cast(value)
  value.to_s[RFC_4122, 0]
end