struct UUID

Overview

Adds CON support to UUID for use in a CON mapping.

NOTE require "uuid/con" is required to opt-in to this feature.

require "con"
require "uuid"
require "uuid/con"

class Example
  CON.mapping id: UUID
end

example = Example.from_con(%({"id": "ba714f86-cac6-42c7-8956-bcf5105e1b81"}))

uuid = UUID.new("87b3042b-9b9a-41b7-8b15-a93d3f17025e")
uuid.to_con # => "87b3042b-9b9a-41b7-8b15-a93d3f17025e"

Included Modules

Defined in:

uuid.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Value

==(other : CON::Any) ==

Instance methods inherited from class Object

===(other : CON::Any) ===, from_con(con : String | IO) from_con, to_con(io : IO)
to_con
to_con
, to_pretty_con(indent : String = " ")
to_pretty_con(io : IO, indent : String = " ")
to_pretty_con

Constructor Detail

def self.from_con(value, pull : CON::PullParser) : UUID #

[View source]
def self.from_con(pull : CON::PullParser) : UUID #

[View source]

Instance Method Detail

def to_con(con : CON::Builder) #

[View source]