Class: Extant::Coercers::Uuid
Constant Summary collapse
- UUID_REGEX =
/\A[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#coerced?, coercer_name, #initialize
Constructor Details
This class inherits a constructor from Extant::Coercers::Base
Instance Method Details
#coerce ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/extant/coercers/uuid.rb', line 5 def coerce if value.to_s =~ UUID_REGEX self.coerced = true value.to_s else UncoercedValue end end |