Class: MySQLBinUUID::Type::Data
- Inherits:
-
ActiveModel::Type::Binary::Data
- Object
- ActiveModel::Type::Binary::Data
- MySQLBinUUID::Type::Data
- Defined in:
- lib/mysql-binuuid/type.rb
Overview
We’re inheriting from the Binary type since ActiveRecord in that case will get the hex value. All we need to do to provide the hex value of the UUID, is to return the UUID without dashes. And because this inherits from Binary::Data, ActiveRecord will quote the hex value as required by the database to store it.
Instance Method Summary collapse
- #hex ⇒ Object
-
#initialize(value) ⇒ Data
constructor
A new instance of Data.
Constructor Details
#initialize(value) ⇒ Data
49 50 51 |
# File 'lib/mysql-binuuid/type.rb', line 49 def initialize(value) @value = value end |
Instance Method Details
#hex ⇒ Object
53 54 55 |
# File 'lib/mysql-binuuid/type.rb', line 53 def hex @value end |