Module: Saxon::ItemType::LexicalStringConversion
- Defined in:
- lib/saxon/item_type/lexical_string_conversion.rb
Overview
A collection of lamba-like objects for converting Ruby values into lexical strings for specific XSD datatypes
Defined Under Namespace
Modules: Convertors, Errors, PatternFragments, Patterns Classes: ByteConversion, DurationConversion, FloatConversion, GDateConversion, IntegerConversion
Class Method Summary collapse
-
.validate(value, item_type, pattern) ⇒ String
Simple validation helper that checks if a value string matches an allowed lexical string pattern space or not.
Class Method Details
.validate(value, item_type, pattern) ⇒ String
Simple validation helper that checks if a value string matches an allowed lexical string pattern space or not.
20 21 22 23 24 |
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 20 def self.validate(value, item_type, pattern) str = value.to_s raise Errors::BadRubyValue.new(value, item_type) if str.match(pattern).nil? str end |