Class: KDL::Types::Regex
- Inherits:
-
Value
- Object
- Value
- KDL::Types::Regex
show all
- Defined in:
- lib/kdl/types/regex.rb
Constant Summary
Constants inherited
from Value
Value::Null
Instance Attribute Summary
Attributes inherited from Value
#format, #type, #value
Class Method Summary
collapse
Methods inherited from Value
#as_type, from, #initialize, #stringify_value, #to_s
Constructor Details
This class inherits a constructor from KDL::Value
Class Method Details
.call(value, type = 'regex') ⇒ Object
4
5
6
7
8
9
|
# File 'lib/kdl/types/regex.rb', line 4
def self.call(value, type = 'regex')
return nil unless value.is_a? ::KDL::Value::String
regex = ::Regexp.new(value.value)
new(regex, type: type)
end
|