Class: IknowParams::Serializer::UUID

Inherits:
String show all
Defined in:
lib/iknow_params/serializer.rb

Instance Attribute Summary

Attributes inherited from IknowParams::Serializer

#clazz

Instance Method Summary collapse

Methods inherited from String

#initialize

Methods inherited from IknowParams::Serializer

#dump, for, for!, #initialize, json_value?, #matches_type!, singleton

Constructor Details

This class inherits a constructor from IknowParams::Serializer::String

Instance Method Details

#load(str) ⇒ Object



232
233
234
235
# File 'lib/iknow_params/serializer.rb', line 232

def load(str)
  matches_type!(str, err: LoadError)
  super
end

#matches_type?(str) ⇒ Boolean

Returns:



237
238
239
# File 'lib/iknow_params/serializer.rb', line 237

def matches_type?(str)
  super && /[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/i.match?(str)
end