Class: RDF::Literal::Day
- Inherits:
-
Date
- Object
- Date
- RDF::Literal::Day
- Defined in:
- lib/rdf/xsd/date.rb
Overview
gDay is a gregorian day that recurs, specifically a day of the month such as the 5th of the month. Arbitrary recurring days are not supported by this datatype. The value space of gDay is the space of a set of calendar dates as defined in ยง 3 of [ISO 8601]. Specifically, it is a set of one-day long, monthly periodic instances.
Constant Summary collapse
- DATATYPE =
RDF::XSD.gDay
- GRAMMAR =
%r(\A---(\d{2})((?:[\+\-]\d{2}:\d{2})|UTC|Z)?\Z).freeze
- FORMAT =
'%d'.freeze
Instance Method Summary collapse
-
#initialize(value, datatype: nil, lexical: nil, **options) ⇒ Day
constructor
A new instance of Day.
Constructor Details
#initialize(value, datatype: nil, lexical: nil, **options) ⇒ Day
Returns a new instance of Day.
83 84 85 86 87 |
# File 'lib/rdf/xsd/date.rb', line 83 def initialize(value, datatype: nil, lexical: nil, **) @string = lexical || value.to_s object = GRAMMAR.match(value.to_s) && ::Date.parse("0000-01-#{$1}#{$2}") super(object, lexical: @string) end |