Class: UUIDTools::UUID
- Inherits:
-
Object
- Object
- UUIDTools::UUID
- Defined in:
- lib/activeuuid/uuid.rb
Instance Method Summary collapse
- #as_json(options = nil) ⇒ Object
-
#quoted_id ⇒ Object
monkey-patch Friendly::UUID to serialize UUIDs to MySQL.
- #to_param ⇒ Object
Instance Method Details
#as_json(options = nil) ⇒ Object
9 10 11 |
# File 'lib/activeuuid/uuid.rb', line 9 def as_json( = nil) hexdigest.upcase end |
#quoted_id ⇒ Object
monkey-patch Friendly::UUID to serialize UUIDs to MySQL
4 5 6 7 |
# File 'lib/activeuuid/uuid.rb', line 4 def quoted_id s = raw.unpack("H*")[0] "x'#{s}'" end |
#to_param ⇒ Object
13 14 15 |
# File 'lib/activeuuid/uuid.rb', line 13 def to_param hexdigest.upcase end |