Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Date._xmlschema
(::String str) -> ::Hash[::Symbol, ::Integer]
Date._xmlschema(string, limit: 128) → hash
ext/date/date_core.c
View on GitHub ↗
static VALUE
date_s__xmlschema(int argc, VALUE *argv, VALUE klass)
{
VALUE str, opt;
rb_scan_args(argc, argv, "1:", &str, &opt);
if (!NIL_P(str)) str = check_limit(str, opt);
return date__xmlschema(str);
}
Returns a hash of values parsed from string, which should be a valid XML date format:
Example
d = Date.new(2001, 2, 3) s = d.xmlschema # => "2001-02-03" Date._xmlschema(s) # => {:year=>2001, :mon=>2, :mday=>3}
See argument limit.
Related: Date.xmlschema (returns a Date object).