Class: KDL::Types::UUID
- Inherits:
-
Value::Custom
- Object
- Value
- Value::Custom
- KDL::Types::UUID
- Defined in:
- lib/kdl/types/uuid.rb
Constant Summary collapse
- RGX =
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Constants inherited from Value
Instance Attribute Summary
Attributes inherited from Value::Custom
Attributes inherited from Value
Class Method Summary collapse
Methods inherited from Value::Custom
Methods inherited from Value
#==, #as_type, from, #initialize, #inspect, #method_missing, #respond_to_missing?, #stringify_value, #to_s, #to_v2, #version
Constructor Details
This class inherits a constructor from KDL::Value
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class KDL::Value
Class Method Details
.call(value, type = 'uuid') ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/kdl/types/uuid.rb', line 8 def self.call(value, type = 'uuid') return nil unless value.is_a? ::KDL::Value::String uuid = value.value.downcase raise ArgumentError, "`#{value.value}' is not a valid uuid" unless uuid =~ RGX new(uuid, type: type) end |